PHPMailer Mailer Error: Message body empty

不打扰是莪最后的温柔 提交于 2019-11-29 08:14:49
Eduardo

I had the same problem and I solved just changing:

This:

$mail->body = 'Hello, this is my message.';

Into this:

$mail->Body = 'Hello, this is my message.';

body into Body what a little mistake!

PHPMailer->MsgHTML() tries to do something clever with fixing non-absolute URLs, but for me too it just returns empty.

$mail->IsHTML(true);
$mail->Body=$body;
emilh8

First I had to enable the ssl extension, (which I have obtained from another post on this site). To do that, open php.ini and enable php_openssl.dll by changing

;extension=php_openssl.dll

to

extension=php_openssl.dll

Now, enable tls and use port 587. Then comment out the preg_replace.

Finally, I was able to make it show up in my gmail "Sent" file, although I was expecting to see it in my "Inbox".

This site is awesome! Thanks.

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