php标头邮件标头“ 554不允许的邮件-标头不符合RFC [291]”]

问题描述 投票:1回答:3

我在将电子邮件发送到yahoo.com电子邮件地址时遇到问题,我从php脚本发送的邮件对于我发送给其他每个域的邮件都非常适用,除了我们坚持保留她的yahoo电子邮件的用户之一。

这是我的标题

    $headers = array();
$headers[] = "MIME-Version: 1.0";
$headers[] = "Content-type: text/plain; charset=iso-8859-1";
$headers[] = "Date: $date";
$headers[] = "From: 'DSAC Events' <$from>";
$headers[] = "Reply-To:  <$replyto>"; 
$headers[] = "Subject: {$subject}";
$headers[] = "Return-Path: <$from>";
$headers[] = "X-Priority: 3";//1 = High, 3 = Normal, 5 = Low
$headers[] = "X-Mailer: PHP/" . phpversion();

mail($to, $subject, $msg, implode("\r\n", $headers));

我已经阅读了很多关于有相同问题的人的文章,我尝试添加message-id和return-path,并添加了日期:阅读后可能是问题所在,而其他各种事情均无济于事。

这里是退回邮件源的示例。

Return-path: <>
Envelope-to: [email protected]
Delivery-date: Sat, 08 Nov 2014 14:41:32 +0000
Received: from mailnull by zeus1.easy-internet.co.uk with local (Exim 4.82)
    id 1Xn7Cm-001cxb-8a
    for [email protected]; Sat, 08 Nov 2014 14:41:32 +0000
X-Failed-Recipients: [email protected]
Auto-Submitted: auto-replied
From: Mail Delivery System <[email protected]>
To: [email protected]
Subject: Mail delivery failed: returning message to sender
Message-Id: <[email protected]>
Date: Sat, 08 Nov 2014 14:41:32 +0000

This message was created automatically by mail delivery software.

A message that you sent could not be delivered to one or more of its
recipients. This is a permanent error. The following address(es) failed:

  [email protected]
    SMTP error from remote mail server after end of data:
    host mta6.am0.yahoodns.net [63.250.192.46]: 554 Message not allowed - Headers are not RFC compliant[291]

------ This is a copy of the message, including all the headers. ------

Return-path: <[email protected]>
Received: from d11dsa by zeus1.easy-internet.co.uk with local (Exim 4.82)
    (envelope-from <[email protected]>)
    id 1Xn7Ci-001cl4-9S
    for [email protected]; Sat, 08 Nov 2014 14:41:29 +0000
To: [email protected]
Subject: 
X-PHP-Script: www.dsa.co.uk/eventmail.php for 2.218.47.72
MIME-Version: 1.0
Content-type: text/plain; charset=iso-8859-1
Date: Sat, 08 Nov 2014 14:41:28 +0000
From: DSACEvents <[email protected]>
Reply-To:  <[email protected]>
Subject: 
X-Priority: 3
php email yahoo rfc compliant
3个回答
4
投票

感谢您的回复,您是对的。这就是我最终得到的效果完美的结果。


0
投票

根据错误消息,似乎Yahoo服务器正在拒绝来自您的域SMTP服务器的电子邮件。这可能是由以下几种原因引起的:


0
投票

我在Yahoo上也遇到了同样的问题。问题只有双重“主体”。干得好,对我来说很好。

© www.soinside.com 2019 - 2024. All rights reserved.