dongzuozhu66776 2017-03-31 06:31
浏览 98
已采纳

PHPMailer电子邮件已成功发送但未收到(EC2)

I am using PHPMailer on EC2. My account is not in a sandbox and Im sending from verified email. Im getting no errors from PHPMailer and thats my log

2017-03-31 06:24:52 Connection: opening to email-smtp.us-west-2.amazonaws.com:587, timeout=300, options=array ( ) 
2017-03-31 06:24:52 Connection: opened 
2017-03-31 06:24:53 SERVER -> CLIENT: 220 email-smtp.amazonaws.com ESMTP SimpleEmailService-2007935443 svKFRJ5M6s1rqbMTRdZu 
2017-03-31 06:24:53 CLIENT -> SERVER: EHLO ***.domain 
2017-03-31 06:24:53 SERVER -> CLIENT: 250-email-smtp.amazonaws.com 250-8BITMIME 250-SIZE 10485760 250-STARTTLS 250-AUTH PLAIN LOGIN 250 Ok 
2017-03-31 06:24:53 CLIENT -> SERVER: STARTTLS 
2017-03-31 06:24:53 SERVER -> CLIENT: 220 Ready to start TLS 
2017-03-31 06:24:53 CLIENT -> SERVER: EHLO ***.domain 
2017-03-31 06:24:53 SERVER -> CLIENT: 250-email-smtp.amazonaws.com 250-8BITMIME 250-SIZE 10485760 250-STARTTLS 250-AUTH PLAIN LOGIN 250 Ok 
2017-03-31 06:24:53 CLIENT -> SERVER: AUTH LOGIN 
2017-03-31 06:24:53 SERVER -> CLIENT: 334 VXNlcm5hbWU6 
2017-03-31 06:24:53 CLIENT -> SERVER: xxx= 
2017-03-31 06:24:53 SERVER -> CLIENT: 334 UGFzc3dvcmQ6 
2017-03-31 06:24:53 CLIENT -> SERVER: xxx= 
2017-03-31 06:24:53 SERVER -> CLIENT: 235 Authentication successful. 
2017-03-31 06:24:53 CLIENT -> SERVER: MAIL FROM: 
2017-03-31 06:24:53 SERVER -> CLIENT: 250 Ok 
2017-03-31 06:24:53 CLIENT -> SERVER: RCPT TO: 
2017-03-31 06:24:53 SERVER -> CLIENT: 250 Ok 
2017-03-31 06:24:53 CLIENT -> SERVER: DATA 
2017-03-31 06:24:53 SERVER -> CLIENT: 354 End data with . 
2017-03-31 06:24:53 CLIENT -> SERVER: Date: Fri, 31 Mar 2017 06:24:52 +0000 
2017-03-31 06:24:53 CLIENT -> SERVER: To: NG 
2017-03-31 06:24:53 CLIENT -> SERVER: From: Me 
2017-03-31 06:24:53 CLIENT -> SERVER: Subject: New User Added 
2017-03-31 06:24:53 CLIENT -> SERVER: Message-ID: <8ada86808c4dc38c21d7ff5d64051951@***.domain> 
2017-03-31 06:24:53 CLIENT -> SERVER: X-Mailer: PHPMailer 5.2.21 (https://github.com/PHPMailer/PHPMailer) 
2017-03-31 06:24:53 CLIENT -> SERVER: MIME-Version: 1.0 
2017-03-31 06:24:53 CLIENT -> SERVER: Content-Type: text/html; charset=iso-8859-1 
2017-03-31 06:24:53 CLIENT -> SERVER: 
2017-03-31 06:24:53 CLIENT -> SERVER: 123 
2017-03-31 06:24:53 CLIENT -> SERVER: 
2017-03-31 06:24:53 CLIENT -> SERVER: . 
2017-03-31 06:24:53 SERVER -> CLIENT: 250 Ok 0101015b2309bfbe-39a8cf31-ad57-4998-832d-94312b7ddfad-000000 
2017-03-31 06:24:53 CLIENT -> SERVER: QUIT 
2017-03-31 06:24:53 SERVER -> CLIENT: 221 Bye 
2017-03-31 06:24:53 Connection: closed 

This is my PHPMailer settings

$this->SMTPDebug = 3;

$this->Host = 'email-smtp.us-west-2.amazonaws.com';
$this->Username = '***';
$this->Password = '***';
$this->SMTPAuth = true;
$this->SMTPSecure = 'tls';
$this->Port = 587;
$this->isHTML(true);
$this->isSMTP();


$this->From = '***';
$this->FromName = '***';
$this->ReturnPath = '***';

I tried to send this to different email but it still not working. Here is actual code of sending

$mailer = new Mailer($API);
$mailer->Subject = 'New User Added';
$mailer->Body = '123';

$mailer->addAddress('***', '***');

if (!$mailer->send()) {
   throw new Exception($mailer->ErrorInfo);
} else {
    print_r('Sent');
}
  • 写回答

1条回答 默认 最新

  • dongtang3155 2017-03-31 16:27
    关注

    I would suggest that you go to https://www.mail-tester.com/ and then copy the email address you see. Update your code and then send an email using PHPMailer to the address you copied. Assuming that your code does actually send the email, and it looks like your code is correct, then Mail Tester will show you what problems your email has.

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥15 硬盘识别不了,需要初始化,可我的数据怎么办
  • ¥15 lvm2被mask了,怎么unmask都没用(标签-ubuntu|关键词-apt)
  • ¥15 交叉注意力机制的残差问题
  • ¥15 微信小程序:渲染收货地址时页面不显示
  • ¥20 win7 64位DirectShow提示初始化失败如何解决?
  • ¥20 小规模孤立词识别系统设计
  • ¥15 关于Java对接海康威视车牌识别一体机SDK是否需要固定外网的IP?
  • ¥15 Linux扩容时,格式化卡住了:vgdispaly查看卷组信息,没有输出
  • ¥18 关于#ubuntu#的问题:使用背景-工作职责内有七八台ubuntu系统的电脑,平时需要互相调取资料,想实现把这几台电脑用交换机组成一个局域网,来实现指定文件夹的互相调取和写入
  • ¥20 求一个简易射频信号综测仪