php send email using gmail smtp

梦想的初衷 提交于 2019-12-06 05:16:25

You should replace the SMTPSecure value from SSL to TLS. It will resolve your issue connect to the Server and mail was sent. I have tested your code it is working fine.

$mail->SMTPSecure = "tls"; // sets the prefix to the servier //$mail->SMTPSecure = "ssl";

Second Replacement is your replayto email $mail->AddReplyTo($youremail, "Reply to"); //optional You have given $emailpassword it is wrong.

$mail->AddReplyTo($emailpassword, "Reply to") ?????

Reply address== mail password ?

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