Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/php/264.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/email/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
PHPMailer无法将邮件发送到@hotmail.com//live.com_Php_Email_Hotmail - Fatal编程技术网

PHPMailer无法将邮件发送到@hotmail.com//live.com

PHPMailer无法将邮件发送到@hotmail.com//live.com,php,email,hotmail,Php,Email,Hotmail,在我的网站上,我使用PHPMailer向客户发送自动邮件。该网站托管在GoDaddy共享托管服务器上,并使用谷歌应用程序作为邮件服务(myserver.com)。SPF记录随myserver.com一起添加 最近,@hotmail.com、@live.com.au、@live.co.uk、@live.com客户抱怨他们没有收到来自网站的任何邮件 我正在使用下面的代码发送邮件 代码1--使用SMTP $mail = new PHPMailer; $mail->isSMTP(); $mail-

在我的网站上,我使用PHPMailer向客户发送自动邮件。该网站托管在GoDaddy共享托管服务器上,并使用谷歌应用程序作为邮件服务(myserver.com)。SPF记录随myserver.com一起添加

最近,@hotmail.com、@live.com.au、@live.co.uk、@live.com客户抱怨他们没有收到来自网站的任何邮件

我正在使用下面的代码发送邮件

代码1--使用SMTP

$mail = new PHPMailer;
$mail->isSMTP();
$mail->SMTPDebug = 0;
$mail->Host = 'localhost';
$mail->Port = 25;
$mail->SMTPSecure = 'none';
$mail->SMTPAuth = false;
$mail->setFrom('confirmation@myserver.com', 'Confirmation[My Server]');
$mail->addReplyTo('info@myserver.com', 'My Server');
$mail->addAddress($client_mailid, $client_mailid);
$mail->Subject = $client_mail_sub;
$mail->msgHTML($newbody);

//send the message
if (!$mail->send()) {
    log_entry($mail->ErrorInfo, MAIL_ERR_LOG);
} else {
    log_entry("Mail sent to ". $client_mailid , MAIL_GEN_LOG);
}
$mail = new PHPMailer;
$mail->setFrom('confirmation@myserver.com', 'Confirmation[My Server]');
$mail->addReplyTo('info@myserver.com', 'My Server');
$mail->addAddress($client_mailid, $client_mailid);
$mail->Subject = $client_mail_sub;
$mail->Host = "myserver.com";
$mail->msgHTML($newbody);

//send the message
if (!$mail->send()) {
    log_entry($mail->ErrorInfo, MAIL_ERR_LOG);
} else {
    log_entry("Mail sent to ". $client_mailid , MAIL_GEN_LOG);
}
我也尝试了下面的代码

代码2——不带SMTP

$mail = new PHPMailer;
$mail->isSMTP();
$mail->SMTPDebug = 0;
$mail->Host = 'localhost';
$mail->Port = 25;
$mail->SMTPSecure = 'none';
$mail->SMTPAuth = false;
$mail->setFrom('confirmation@myserver.com', 'Confirmation[My Server]');
$mail->addReplyTo('info@myserver.com', 'My Server');
$mail->addAddress($client_mailid, $client_mailid);
$mail->Subject = $client_mail_sub;
$mail->msgHTML($newbody);

//send the message
if (!$mail->send()) {
    log_entry($mail->ErrorInfo, MAIL_ERR_LOG);
} else {
    log_entry("Mail sent to ". $client_mailid , MAIL_GEN_LOG);
}
$mail = new PHPMailer;
$mail->setFrom('confirmation@myserver.com', 'Confirmation[My Server]');
$mail->addReplyTo('info@myserver.com', 'My Server');
$mail->addAddress($client_mailid, $client_mailid);
$mail->Subject = $client_mail_sub;
$mail->Host = "myserver.com";
$mail->msgHTML($newbody);

//send the message
if (!$mail->send()) {
    log_entry($mail->ErrorInfo, MAIL_ERR_LOG);
} else {
    log_entry("Mail sent to ". $client_mailid , MAIL_GEN_LOG);
}
我的密码有问题吗? 如果没有问题,问题的原因是什么

我已经搜索了很多次,找到了下面这个问题的一个解决方案,尝试了很多解决方法,但没有任何效果。如果这是一个重复的问题,我很抱歉

谢谢你的帮助

编辑 添加了标题信息

Delivered-To: abc@gmail.com
Received: by 10.96.137.33 with SMTP id qf1csp1412957qdb;
        Wed, 17 Dec 2014 06:47:28 -0800 (PST)
X-Received: by 10.66.124.225 with SMTP id ml1mr5209349pab.142.1418827647092;
        Wed, 17 Dec 2014 06:47:27 -0800 (PST)
Return-Path: <confirmation@myserver.com>
Received: from sg2nlshrout01.shr.prod.sin2.secureserver.net (sg2nlshrout01.shr.prod.sin2.secureserver.net. [182.50.132.193])
        by mx.google.com with ESMTP id it2si5932112pbb.105.2014.12.17.06.47.24;
        Wed, 17 Dec 2014 06:47:26 -0800 (PST)
Received-SPF: pass (google.com: domain of confirmation@myserver.com designates 182.50.132.193 as permitted sender) client-ip=182.50.132.193;
Authentication-Results: mx.google.com;
       spf=pass (google.com: domain of confirmation@myserver.com designates 182.50.132.193 as permitted sender) smtp.mail=confirmation@myserver.com
Received: from sg2nlhg144.shr.prod.sin2.secureserver.net ([182.50.130.216])
    by sg2nlshrout01.shr.prod.sin2.secureserver.net with bizsmtp
    id Uen91p0094gGj8e01en9ff; Wed, 17 Dec 2014 07:47:09 -0700
Received: from www.myserver.com (localhost [127.0.0.1])
    by sg2nlhg144.shr.prod.sin2.secureserver.net (8.14.4/8.12.11) with ESMTP id sBHElOQA024281;
    Wed, 17 Dec 2014 07:47:24 -0700
Date: Wed, 17 Dec 2014 14:47:24 +0000
To: "Confirmation[My Server]" <confirmation@myserver.com>,
        "My Server" <info@myserver.com>
From: "Confirmation[My Server]" <confirmation@myserver.com>
Reply-To: "My Server" <info@myserver.com>
Subject: XXXXXXXXXXXXXXXXXXXXXX.
Message-ID: <209589041f9f422b4a259b3796e90cbc@www.myserver.com>
X-Priority: 3
X-Mailer: PHPMailer 5.2.9 (https://github.com/PHPMailer/PHPMailer/)
MIME-Version: 1.0
Content-Type: multipart/alternative;
    boundary="b1_209589041f9f422b4a259b3796e90cbc"
Content-Transfer-Encoding: 8bit

--b1_209589041f9f422b4a259b3796e90cbc
Content-Type: text/plain; charset=us-ascii

To view the message, please use an HTML compatible email viewer!


--b1_209589041f9f422b4a259b3796e90cbc
Content-Type: text/html; charset=iso-8859-1
Content-Transfer-Encoding: 8bit
交付给:abc@gmail.com
收到日期:10.96.137.33,SMTP id为QF1CS1412957QDB;
2014年12月17日星期三06:47:28-0800(太平洋标准时间)
X-Received:10.66.124.225,SMTP id为ml1mr5209349pab.142.1418827647092;
2014年12月17日星期三06:47:27-0800(太平洋标准时间)
返回路径:
收到:来自sg2nlshrout01.shr.prod.sin2.secureserver.net(sg2nlshrout01.shr.prod.sin2.secureserver.net。[182.50.132.193])
由mx.google.com以ESMTP id it2si5932112pbb.105.2014.12.17.06.47.24发布;
2014年12月17日星期三06:47:26-0800(太平洋标准时间)
收到SPF:pass(google.com:domain of ofconfirmation@myserver.com指定182.50.132.193为允许的发送方)客户端ip=182.50.132.193;
认证结果:mx.google.com;
spf=pass(google.com:domain of ofconfirmation@myserver.com将182.50.132.193指定为允许的发件人)smtp.mail=confirmation@myserver.com
收到:来自sg2nlhg144.shr.prod.sin2.secureserver.net([182.50.130.216])
通过sg2nlshrout01.shr.prod.sin2.secureserver.net和bizsmtp
id Uen91p0094gGj8e01en9ff;2014年12月17日星期三07:47:09-0700
收到:来自www.myserver.com(localhost[127.0.0.1])
由sg2nlhg144.shr.prod.sin2.secureserver.net(8.14.4/8.12.11)提供,ESMTP id为sBHElOQA024281;
2014年12月17日星期三07:47:24-0700
日期:2014年12月17日星期三14:47:24+0000
致:“确认[我的服务器]”,
“我的服务器”
发件人:“确认[我的服务器]”
回复:“我的服务器”
主题:XXXXXXXXXXXXXXXXXX。
消息ID:
X优先级:3
X-Mailer:PHPMailer 5.2.9(https://github.com/PHPMailer/PHPMailer/)
MIME版本:1.0
内容类型:多部分/备选;
boundary=“b1_209589041F9F42B4A259B3796E90CBC”
内容传输编码:8比特
--b1_209589041f9f422b4a259b3796e90cbc
内容类型:文本/纯文本;字符集=美国ascii码
要查看邮件,请使用兼容HTML的电子邮件查看器!
--b1_209589041f9f422b4a259b3796e90cbc
内容类型:text/html;字符集=iso-8859-1
内容传输编码:8比特

这与代码无关。电子邮件可能会变成垃圾。@Raptor很奇怪。。。通常,当我们使用SMTP时,目标服务器会接受邮件…@prajilal PHPMailer是否会在日志文件中写入内容?另一个问题,你能在你的邮箱里看到邮件吗?@VitorLima是的,我能在邮箱里看到。错误日志文件中未写入任何错误日志,成功日志文件的行为“Mail sent to”abc@hotmail.com“@Raptor thamk感谢您的回复。我已经设置了mail()函数来发送邮件,测试后我会发布测试结果。我使用的代码:$headers=“From:”$来自邮件。“\r\n”$标题。=“MIME版本:1.0\r\n”$标题。=“内容类型:text/html;字符集=ISO-8859-1\r\n”;邮件($to、$subject、$body、$headers);