-1

我有一个发送确认电子邮件的网站。当我直接向我的 gmail 帐户或工作帐户发送电子邮件时,它会按预期显示,但是,当它通过另一个通过 godaddy 或通过 Network Solutions 注册的电子邮件地址时,它会显示如下:

Reply-To: tom@yahoo.com

    Content-Type: text/html; boundary="PHP-alt-cabc44cdb6c49a722d25637d7407d89c"
    Message-Id: <20121024134543.9B59E10076@server1.serverdomain.com>
    Date: Wed, 24 Oct 2012 08:45:43 -0500 (CDT)

    <html><body><h1>You have been registered for Future Event</h1><div><b>Date:</b> March 4th, 2013</div><div><b>Time:</b> 12:00am</div><div><p>Come one come all.  Step into the future</p></div><div><a href="http://example.com/create_ical/?m=6ea267734713bd10" target="_blank">Download to your calendar</a></div><a href="http://www.example.com/adtracking/?a=532ff9c94b851df4&l=http://www.example.com/?x=ad" target="_blank"  style="border-width:0px; margin-left:auto; margin-right:auto; display:block; margin-top:20px;"><img src="http://www.example.com/i/ads/57db2ce3d22e4636_ad_mrc_300_250.jpg"  style="border-width:0px; margin-left:auto; margin-right:auto; display:block; margin-top:20px;"></a></body></html>

Godaddy基本上说这是我的错,他们不负责任。

这就是我设置标题的方式:

$_HEADERS = "From: " . $_HOST["email"] . "\r\nReply-To: " . $_HOST["email"] . "";
$_HEADERS .= "\r\nContent-Type: text/html; boundary=\"PHP-alt-".$_random_hash."\"";

这是完整的电子邮件:

Delivered-To: through-godaddy-to-my-account-at@gmail.com
Received: by 10.58.227.40 with SMTP id rx8csp526380vec;
        Wed, 24 Oct 2012 06:46:02 -0700 (PDT)
Received: by 10.52.90.212 with SMTP id by20mr22114953vdb.118.1351086361703;
        Wed, 24 Oct 2012 06:46:01 -0700 (PDT)
Received-SPF: pass (google.com: best guess record for domain of server1.serverdomain.com designates 66.18.17.26 as permitted sender) client-ip=66.18.17.26;
Message-ID: <5087f119.9bcfdc0a.6321.234eMFETCHER_ADDED@google.com>
Received: by 10.220.207.155 with POP3 id fy27mf482750vcb.7;
        Wed, 24 Oct 2012 06:46:01 -0700 (PDT)
X-Gmail-Fetch-Info: email-at-godaddy@example.com 1 pop.secureserver.net 110 email-at-godaddy@example.com
Received: (qmail 13064 invoked by uid 30297); 24 Oct 2012 13:45:46 -0000
Received: from unknown (HELO m1pismtp01-016.prod.mesa1.secureserver.net) ([10.8.12.16])
          (envelope-sender <apache@server1.serverdomain.com>)
          by p3plsmtp14-04.prod.phx3.secureserver.net (qmail-1.03) with SMTP
          for <email-at-godaddy@example.com>; 24 Oct 2012 13:45:46 -0000
X-IronPort-Anti-Spam-Result: ApIxAH/wh1BCEhEa/2dsb2JhbABEghiJdKNaMQEBkGdwgQiCGoEzID4ZASqFSQeCGAkBAw8LmXGPHId3ASOVAmeDSYIegQYDlCKCaIQihXCFEA
Received: from server1.serverdomain.com ([66.18.17.26])
  by m1pismtp01-016.prod.mesa1.secureserver.net with ESMTP; 24 Oct 2012 06:45:45 -0700
Received: by server1.serverdomain.com (Postfix, from userid 48)
    id 9B59E10076; Wed, 24 Oct 2012 08:45:43 -0500 (CDT)
To: email-at-godaddy@example.com
Subject: You have successfully registered for Future Event
From: tom@yahoo.com
X-Nonspam: None
Date: Wed, 24 Oct 2012 06:46:01 -0700 (PDT)

Reply-To: tom@yahoo.com

Content-Type: text/html; boundary="PHP-alt-cabc44cdb6c49a722d25637d7407d89c"
Message-Id: <20121024134543.9B59E10076@server1.serverdomain.com.com>
Date: Wed, 24 Oct 2012 08:45:43 -0500 (CDT)

<html><body><h1>You have been registered for Future Event</h1><div><b>Date:</b> March 4th, 2013</div><div><b>Time:</b> 12:00am</div><div><p>Come one come all.  Step into the future</p></div><div><a href="http://example.com/create_ical/?m=6ea267734713bd10" target="_blank">Download to your calendar</a></div><a href="http://www.example.com/adtracking/?a=532ff9c94b851df4&l=http://www.example.com/?x=ad" target="_blank"  style="border-width:0px; margin-left:auto; margin-right:auto; display:block; margin-top:20px;"><img src="http://www.example.com/i/ads/57db2ce3d22e4636_ad_mrc_300_250.jpg"  style="border-width:0px; margin-left:auto; margin-right:auto; display:block; margin-top:20px;"></a></body></html>
4

1 回答 1

1

如果您要发送多部分消息,则应仅使用“边界”。这可能会使 GoDaddy 的解析器或垃圾邮件检查器或其他任何东西感到困惑;他们打开您的邮件并重新打包,使其看起来“错误”。

然而,如果 GoDaddy 不像 Google 那样“在接受的东西上那么自由”,那并不是真正的 GoDaddy 的错。

查看诸如 PHPMailer 或multipart structure之类的类;或者只发送没有边界的 HTML(参见例如http://www.w3schools.com/php/func_mail_mail.asp)。

更新

将您的标头与另一封 HTML 邮件进行比较,会出现一些差异:

From: tom@yahoo.com
X-Nonspam: None
Date: Wed, 24 Oct 2012 06:46:01 -0700 (PDT)

Reply-To: tom@yahoo.com

Content-Type: text/html; boundary="PHP-alt-cabc44cdb6c49a722d25637d7407d89c"
Message-Id: <20121024134543.9B59E10076@server1.serverdomain.com.com>
Date: Wed, 24 Oct 2012 08:45:43 -0500 (CDT)


From: <redacted>
To: <redacted>
Date: Mon, 04 Apr 2011 10:33:32 +0200
MIME-Version: 1.0
Content-Type: text/html; charset="ISO-8859-15"

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">

具体来说,“Reply-To:”周围的那些空行可能会使系统认为标题已终止,接下来是电子邮件文本内容。这可能是由组合标题时不正确的行终止符引起的。

于 2012-10-24T14:10:13.463 回答