我正在使用sendgrid,我想設置我發送的電子郵件的樣式,但在電子郵件中,他們顯示原始代碼我不知道為什么。有沒有我做不正確的地方或什么?這是我寫的代碼...require 'vendor/autoload.php'; $email = new \SendGrid\Mail\Mail();$email->setFrom("my email address");$email->setSubject("Welcome");$email->addTo($EmailAddress);//Below code where i am having issues$email->addContent("text/plain", "<img src='Assets/images/logo.png'> Welcome To my channel...");$sendgrid = new \SendGrid('your api code');$sendgrid->send($email);
1 回答

慕后森
TA貢獻1802條經驗 獲得超5個贊
您的內容類型錯誤。您必須將其設置為:text/html
$email->addContent("text/html", "<img src='Assets/images/logo.png'> Welcome To my channel...");
否則,即使您編寫了 html,它也不會呈現為 html。
- 1 回答
- 0 關注
- 95 瀏覽
添加回答
舉報
0/150
提交
取消