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 fluent的在模拟压强时使用希望得到一些建议
    • ¥15 STM32驱动继电器
    • ¥15 Windows server update services
    • ¥15 关于#c语言#的问题:我现在在做一个墨水屏设计,2.9英寸的小屏怎么换4.2英寸大屏
    • ¥15 模糊pid与pid仿真结果几乎一样
    • ¥15 java的GUI的运用
    • ¥15 Web.config连不上数据库
    • ¥15 我想付费需要AKM公司DSP开发资料及相关开发。
    • ¥15 怎么配置广告联盟瀑布流
    • ¥15 Rstudio 保存代码闪退