为了账号安全,请及时绑定邮箱和手机立即绑定

PHPMailer - SMTP ERROR:从我的服务器发送邮件时密码命令失败

PHPMailer - SMTP ERROR:从我的服务器发送邮件时密码命令失败

PHP
一只甜甜圈 2019-08-26 14:37:48
PHPMailer - SMTP ERROR:从我的服务器发送邮件时密码命令失败我已经使用phpmailer()概念使用php脚本从我的共享服务器向用户发送邮件,但是根据phpmailer代码,即使我的脚本中的所有内容都正确,我也无法发送。我的代码是这样的:  $message = " This is testing message from my server";   $mail = new PHPMailer(); // create a new object   $mail->IsSMTP(); // enable SMTP   $mail->Host = "smtp.gmail.com";   $mail->SMTPDebug = 1; // debugging: 1 = errors and messages, 2 = messages only   $mail->SMTPAuth = true; // authentication enabled   $mail->SMTPSecure = 'ssl'; // secure transfer enabled REQUIRED for GMail   $mail->Port = 465; // or 587   $mail->IsHTML(true);   $mail->Username = "moorthi.mrk10@gmail.com"; // My gmail username   $mail->Password = "************"; // My Gmail Password   $mail->SetFrom("moorthi.mrk10@gmail.com");   $mail->Subject = "Test Mail from my Server";   $mail->Body = $message;   $mail->AddAddress($email);    if($mail->Send())       {     print json_encode("SUCCESS");}else{     echo "Mailer Error: " . $mail->ErrorInfo;}注意: 我使用“GMail”作为我的SMTP服务器,SMTPSecure是“ssl”,端口是“465”,用户名和密码是我的GMail用户名和密码我使用VPS共享服务器,并将我的PHP脚本保存在该服务器上。我认为我的PHP脚本没有问题,我不知道为什么它不起作用。我得到了这样的错误。  2014-02-21 12:30:11   CLIENT -> SERVER: EHLO jkcorporates.com  2014-02-21 12:30:11   CLIENT -> SERVER: AUTH LOGIN  2014-02-21 12:30:11   CLIENT -> SERVER: bW9vcnRoaS5tcmsxMEBnbWFpbC5jb20=   2014-02-21 12:30:11   CLIENT -> SERVER: OTk0MTI0MTE0MA==   2014-02-21 12:30:11   SMTP ERROR: Password command failed: 534-5.7.14    534-5.7.14 i-_eumA> Please log in via your web browser and then try again.   534 5.7.14 54 k76sm17979938yho.18 - gsmtp  2014-02-21 12:30:11   CLIENT -> SERVER: QUIT  " The ERROR is  "  SMTP connect() failed.请给出一些解决方案。提前致谢。请记住:我使用共享服务器名称'VPS.mydomain.com',我想使用GMail作为我的SMTP服务器向用户发送邮件。
查看完整描述

添加回答

代码语言

举报

0/150
提交
取消
微信客服

购课补贴
联系客服咨询优惠详情

帮助反馈 APP下载

慕课网APP
您的移动学习伙伴

公众号

扫描二维码
关注慕课网微信公众号