PHPMailer IsHTML(true) not working

风流意气都作罢 提交于 2019-12-02 00:56:40

Why would you not expect it to use HTML if you call IsHTML(true)? That's how you tell PHPMailer to treat your message body as HTML! If you don't want HTML as the content type, call IsHTML(false), or just don't call it at all since plain text is the default.

If you want both HTML and plain text, call msgHTML($html) instead and it will also handle the HTML->text conversion for you.

As Chris said, call IsHTML before setting Body.

And as Dagon said, if you put HTML in $message, it will send HTML...

Unless I'm misunderstanding your question, it should be sending the HTML tags. Check that the received email has the Content-Type: is text/html.

It has to send the HTML tags still for the client at the other side to be able to display it properly. If the message contains HTML tags and you don't want the tags, then you want to call IsHtml(false) and you need to actually strip the HTML from the message.

Not all email clients can read HTML tags. So if you're seeing the HTML it's either because your client can't render HTML, or that the Content-Type: is text/plain.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!