Unable to send mail through Google SMTP with PHPMailer

余生颓废 提交于 2019-12-01 06:45:39

Ok, the problem was the version of PHPMailer. I updated to PHPMailer version 5 and everything worked great. I was using phpMailer version 1.02.

I had similar problems with GMail when using it through CodeIgniter

For me, changing the host option worked:

$mail->Host = "ssl://smtp.googlemail.com";

Set $mail->SMTPDebug = 1; It will give you more info about this error. Most likely you will get "Unable to find the socket transport "ssl" - did you forget to enable it when you configured PHP". To fix this remove ";" from ;extension=php_openssl.dll line in php.ini.

PS I also like XAMPP :)))

$host = "ssl://smtp.gmail.com"; $port = "465"

I changed from SSL to ssl. It works.

According to this post here, Google may not be offering this service any more:

http://www.web-development-blog.com/archives/send-e-mail-messages-via-smtp-with-phpmailer-and-gmail/

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