脚本宝典收集整理的这篇文章主要介绍了phpmailer – SMTP – >错误:服务器不接受RCPT,脚本宝典觉得挺不错的,现在分享给大家,也给大家做个参考。
require("PHPmailer.inc.PHP"); class sendmail { public static function sendAccountActivateMail($to,$subject,&message) { $flg = false; try { $mail= new PHPMailer(); $mail->Issmtp(); $mail->SMTPAuth= true; $mail->SMTPSecure= "tls"; $mail->Host= "smtp.gmail.com"; $mail->Port= 587; $mail->Username= "xxx@mydomain.COM"; $mail->Password= "xxxxxx"; $mail->AddReplyTo("info@mydomain.com"); $mail->From= "info@mydomain.com"; $mail->FromName= "WebsITe"; $mail->Subject= $subject; $mail->WordWrap= 50; $mail->Body = $message; $mail->AddAddress($to); $mail->Send(); } catch(Exception $e) { $flg = false; } return $flg; } }
尝试通过PHPmailer发送邮件与smtp.
打开调试给我错误:
SMTP – >错误:服务器不接受RCPT:550端口587 SMTP上提交邮件需要SMTP AUTH – >错误:服务器不接受DATA命令:SMTP – >注意:检查是否已连接时捕获了EOF
$mail= new PHPMailer(); $mail->IsSMTP(); $mail->SMTPAuth= true; $mail->SMTPSecure= "ssl"; $mail->Host= "smtp.gmail.com"; $mail->Port= 465;.....
以上是脚本宝典为你收集整理的phpmailer – SMTP – >错误:服务器不接受RCPT全部内容,希望文章能够帮你解决phpmailer – SMTP – >错误:服务器不接受RCPT所遇到的问题。
本图文内容来源于网友网络收集整理提供,作为学习参考使用,版权属于原作者。
如您有任何意见或建议可联系处理。小编QQ:384754419,请注明来意。