dpwh11290 2019-03-07 08:08
浏览 443

SMTP服务器错误:发送Outlook邮件时使用PHPMailer

Here is my code, The same code is working gmail and yahoo but outlook or hotmail getting this issue

include("phpmailer/class.phpmailer.php");
$mail = new PHPMailer();
$mail->IsSMTP();
$mail->CharSet = 'UTF-8';
$mail->Host = "smtp.live.com";//tried smtp-mail.outlook.com,smtp.office365.com
$mail->SMTPAuth= true;
$mail->Port = 587;
$mail->Username= $account;
$mail->Password= $password;
$mail->SMTPSecure = 'tls';
$mail->From = $from;
$mail->FromName= $from_name;
$mail->isHTML(true);
$mail->Subject = $subject;
$mail->Body = $msg;
$mail->addAddress($to);
if(!$mail->send()){
 echo "Mailer Error: " . $mail->ErrorInfo;
}else{
 echo "E-Mail has been sent";
}

Getting below Error.

SMTP -> FROM SERVER:220 DM5PR0101CA0036.outlook.office365.com Microsoft ESMTP MAIL Service ready at Thu, 7 Mar 2019 07:59:09 +0000 
SMTP -> FROM SERVER: 250-DM5PR0101CA0036.outlook.office365.com Hello [146.148.75.233] 250-SIZE 157286400 250-PIPELINING 250-DSN 250-ENHANCEDSTATUSCODES 250-STARTTLS 250-8BITMIME 250-BINARYMIME 250-CHUNKING 250 SMTPUTF8 
SMTP -> FROM SERVER:220 2.0.0 SMTP server ready 
SMTP -> FROM SERVER: 250-DM5PR0101CA0036.outlook.office365.com Hello [146.148.75.233] 250-SIZE 157286400 250-PIPELINING 250-DSN 250-ENHANCEDSTATUSCODES 250-AUTH LOGIN XOAUTH2 250-8BITMIME 250-BINARYMIME 250-CHUNKING 250 SMTPUTF8 
SMTP -> ERROR: Password not accepted from server: 
SMTP -> FROM SERVER:535 5.7.3 Authentication unsuccessful [DM5PR0101CA0036.prod.exchangelabs.com] 
SMTP -> ERROR: RSET failed: 535 5.7.3 Authentication unsuccessful [DM5PR0101CA0036.prod.exchangelabs.com] 
SMTP Error: Could not authenticate. Mailer Error: SMTP Error: Could not authenticate.
SMTP server error: 5.7.3 Authentication unsuccessful [DM5PR0101CA0036.prod.exchangelabs.com]
  • 写回答

0条回答

    报告相同问题?

    悬赏问题

    • ¥15 素材场景中光线烘焙后灯光失效
    • ¥15 请教一下各位,为什么我这个没有实现模拟点击
    • ¥15 执行 virtuoso 命令后,界面没有,cadence 启动不起来
    • ¥50 comfyui下连接animatediff节点生成视频质量非常差的原因
    • ¥20 有关区间dp的问题求解
    • ¥15 多电路系统共用电源的串扰问题
    • ¥15 slam rangenet++配置
    • ¥15 有没有研究水声通信方面的帮我改俩matlab代码
    • ¥15 ubuntu子系统密码忘记
    • ¥15 保护模式-系统加载-段寄存器