无法从PHPMailer发送电子邮件,没有错误,消息成功

时间:2015-12-02 01:32:45

标签: php email

我正在尝试使用PHPMailer发送电子邮件

我拥有所有正确的设置,并根据CPanel电子邮件跟踪成功发送电子邮件。

但是,我没有收到任何电子邮件

只有在我发送到Gmail时才会出现这种情况(我还没有测试过雅虎或其他任何内容)。 如果我发送到我自己的域名,即@ open-plant.com ..它工作正常。收到电子邮件

我查了GMAIL垃圾邮件,垃圾邮件,垃圾邮件等等......它不会去那些地方。

电子邮件跟踪显示成功但无电子邮件地址为azrinsani@gmail.com:

vent: success success
User: azrinsani
Domain:   open-plant.com
Sender:   sales@open-plant.com
Sent Time:    Dec 2, 2015 9:25:09 AM
Sender Host:  pa49-196-132-8.pa.vic.optusnet.com.au
Sender IP Address:    49.196.132.8
Authentication:   dovecot_login
Spam Score:   0
Recipient:    azrinsani@gmail.com
Delivery User:    -remote-
Delivery Domain:  
Delivered To: azrinsani@gmail.com
Router:   smarthost_dkim
Transport:    remote_smtp_smart_dkim
Out Time: Dec 2, 2015 9:25:09 AM
ID:   1a3wAX-003r8M-GZ
Delivery Host:    se3-syd.hostedmail.net.au
Delivery IP Address:  103.252.152.0/24
Size: 709 bytes
Result:   Accepted

以下是我的phpcode

<?php
require 'PHPMailerAutoload.php';
$mail = new PHPMailer();
$mail->IsSMTP();
$mail->Mailer = 'smtp';
$mail->SMTPAuth = true;



$mail->SMTPDebug = 1; // debugging: 1 = errors and messages, 2 = messages only
$mail->Port = 465; // or 587
$mail->Host = 'c1s4-2e-syd.hosting-services.net.au'; // "ssl://smtp.gmail.com" didn't worked
$mail->SMTPSecure = 'ssl';

$mail->Username = "sales@open-plant.com";
$mail->Password = "PASSWORDCENSORED";
$mail->IsHTML(true); // if you are going to send HTML formatted emails
$mail->SingleTo = true; // if you want to send a same email to multiple users. multiple emails will be sent one-by-one.

$mail->From = "sales@open-plant.com";
$mail->FromName = "Open-Plant";
$mail->addAddress("azrinsani@gmail.com","User 1");

$mail->Subject = "TESTING PHPMailer";
$mail->Body = "Hi,<br /><br />This system is working perfectly.";

if(!$mail->Send())
    echo "Message was not sent <br />PHPMailer Error: " . $mail->ErrorInfo;
else
    echo "Message has been sent";

?>

1 个答案:

答案 0 :(得分:1)

解决了问题!

好的,事实证明我的托管服务器阻止了电子邮件。他们说他们有垃圾邮件过滤器,我的电子邮件被抓了。所以,经验教训=不要信任电子邮件痕迹...因为他们的电子邮件痕迹说一切都很好!