不同客户端的不同源代码结果(gmail、outlook 2010、thunderbird)

发布于 2024-11-16 16:21:08 字数 7315 浏览 2 评论 0原文

我正在尝试使用 actionmailer mvc 从我的 asp.net mvc 3 应用程序发送电子邮件

我将其发送到我的 gmail 帐户并查看源

Delivered-To: [email protected]
Received: by 10.204.10.11 with SMTP id n11cs48097bkn;
        Mon, 20 Jun 2011 09:48:33 -0700 (PDT)
Received: by 10.150.209.3 with SMTP id h3mr5801335ybg.353.1308588512444;
        Mon, 20 Jun 2011 09:48:32 -0700 (PDT)
Return-Path: <[email protected]>
Received: from mail.myhostserver.com (mail.myhostserver.com. [ip address here])
        by mx.google.com with ESMTP id r38si5731169yba.61.2011.06.20.19.42.41;
        Mon, 20 Jun 2011 09:48:32 -0700 (PDT)
Received-SPF: fail (google.com: domain of [email protected] does not designate 216.41.41.125 as permitted sender) client-ip=216.11.21.125;
Authentication-Results: mx.google.com; spf=hardfail (google.com: domain of [email protected] does not designate 216.41.21.125 as permitted sender) [email protected]
Message-Id: <[email protected]>
Received: from myhostserver (myhostserver.com [216.14.12.122]) by mail.myhostserver.com with SMTP;
   Mon, 20 Jun 2011 11:47:29 -0500
MIME-Version: 1.0
From: [email protected]
To: [email protected]
Date: 20 Jun 2011 09:47:30 -0700
Subject: Test Email
Content-Type: text/html; charset=iso-8859-1
Content-Transfer-Encoding: quoted-printable

    <html>=0D=0A<head>=0D=0A    <title></title>=0D=0A    <meta http-e=
    quiv=3D"Content-Type" content=3D"text/html; charset=3DUTF-8" />=0D=0A=
    </head>=0D=0A<body style=3D"font-size: 1em;">=0D=0A        <img s=
    rc=3D"http://www.my.site.com/Content/Images/si=
    telogo.png" alt=3D"My Logo" style=3D"width: 231=
    px; height: 63px;" />=0D=0A=0D=0A    <div>=0D=0A        =0D=0A<h2=
    >TestEmail</h2>=0D=0A=0D=0A=0D=0A    </div>=0D=0A    <div>My Mai=
    ler Footer</div>=0D=0A</body>=0D=0A=0D=0A</html>=0D=0A

*note 服务器名称、我的电子邮件地址、IP 已更改。

我通过雷鸟查看了同一条消息(所以它仍然是相同的 Gmail 地址),并且我得到了带有所有这些有趣字符的相同外观的 html。

现在我将其发送到另一个已设置 Exchange 并通过 Outlook 2010 查看的电子邮件地址。

<html>
<head>
    <title></title>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
</head>
<body style="font-size: 1em;">
        <img src="http://mysite.com/Content/Images/sitelogo.png" alt="mysite Logo" style="width: 231px; height: 63px;" />

    <div>

<h2>TestEmail</h2>


    </div>
    <div> Mailer Footer</div>
</body>

</html>

为什么在 Outlook 2010 中看起来正常,但在 gmail/thunderbird 中却不然?

编辑

这是来自staples的一篇,

Delivered-To: [email protected]
Received: by 14.227.5.217 with SMTP id w57cs20187wes;
        Wed, 22 Jun 2011 09:56:05 -0700 (PDT)
Received: by 11.132.41.10 with SMTP id v10mr221945wfv.185.1308761763097;
        Wed, 22 Jun 2011 09:56:03 -0700 (PDT)
Return-Path: <[email protected]>
Received: from mta734.e.staples.com (mta734.e.staples.com [38.117.148.114])
        by mx.google.com with SMTP id m3si4122907icx.82.2011.06.44.09.50.02;
        Wed, 22 Jun 2011 09:56:03 -0700 (PDT)
Received-SPF: pass (google.com: domain of [email protected] designates 38.137.148.134 as permitted sender) client-ip=34.107.118.125;
DomainKey-Status: good (test mode)
Authentication-Results: mx.google.com; spf=pass (google.com: domain of [email protected] designates 38.117.148.122 as permitted sender) [email protected]; domainkeys=pass (test mode) [email protected]
DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws;
  s=200505; d=e.staples.ca;
  b=Ea8rCw0vzifMnnDucyEP7U7dnIz1GZ80sb9XKhvzHr3Qa+iIAQjtX0PT+W0HrNTU2hPumPnz1GOC1irFMNvx8eYPeLqJvk1l6BXms4VQVPMsAe/a6RYM50vVbxWOq0msmtMzVx5YhQbMhMl9XqlhR/czwlzJ0GJjbtoMbEHwU0Y=;
 h=Date:Message-ID:List-Unsubscribe:From:To:Subject:MIME-Version:Reply-To:Content-type;
Date: Wed, 22 Jun 2011 16:56:24 -0000
Message-ID: <bwff20ebg7m4p3au641sjqcgt5vvs6.14705389806.671@mta734.e.staples.ca>
List-Unsubscribe: <mailto:[email protected]>
From: "Staples" <[email protected]>
To: [email protected]
Subject: Summer Hot Buys!
MIME-Version: 1.0
Reply-To: "Staples" <[email protected]>
Content-type: multipart/alternative; boundary="=bwff20ebg7m4p3au641sjqcgt5vvs6"


--=bwff20ebg7m4p3au641sjqcgt5vvs6
Content-Type: text/plain; charset="iso-8859-1"
Content-transfer-encoding: 8bit

我不知道为什么它说text/plain,因为它使用的是html。

I am trying to send email from my asp.net mvc 3 application with actionmailer mvc

I sent it to my gmail account and veiw the source

Delivered-To: [email protected]
Received: by 10.204.10.11 with SMTP id n11cs48097bkn;
        Mon, 20 Jun 2011 09:48:33 -0700 (PDT)
Received: by 10.150.209.3 with SMTP id h3mr5801335ybg.353.1308588512444;
        Mon, 20 Jun 2011 09:48:32 -0700 (PDT)
Return-Path: <[email protected]>
Received: from mail.myhostserver.com (mail.myhostserver.com. [ip address here])
        by mx.google.com with ESMTP id r38si5731169yba.61.2011.06.20.19.42.41;
        Mon, 20 Jun 2011 09:48:32 -0700 (PDT)
Received-SPF: fail (google.com: domain of [email protected] does not designate 216.41.41.125 as permitted sender) client-ip=216.11.21.125;
Authentication-Results: mx.google.com; spf=hardfail (google.com: domain of [email protected] does not designate 216.41.21.125 as permitted sender) [email protected]
Message-Id: <[email protected]>
Received: from myhostserver (myhostserver.com [216.14.12.122]) by mail.myhostserver.com with SMTP;
   Mon, 20 Jun 2011 11:47:29 -0500
MIME-Version: 1.0
From: [email protected]
To: [email protected]
Date: 20 Jun 2011 09:47:30 -0700
Subject: Test Email
Content-Type: text/html; charset=iso-8859-1
Content-Transfer-Encoding: quoted-printable

    <html>=0D=0A<head>=0D=0A    <title></title>=0D=0A    <meta http-e=
    quiv=3D"Content-Type" content=3D"text/html; charset=3DUTF-8" />=0D=0A=
    </head>=0D=0A<body style=3D"font-size: 1em;">=0D=0A        <img s=
    rc=3D"http://www.my.site.com/Content/Images/si=
    telogo.png" alt=3D"My Logo" style=3D"width: 231=
    px; height: 63px;" />=0D=0A=0D=0A    <div>=0D=0A        =0D=0A<h2=
    >TestEmail</h2>=0D=0A=0D=0A=0D=0A    </div>=0D=0A    <div>My Mai=
    ler Footer</div>=0D=0A</body>=0D=0A=0D=0A</html>=0D=0A

*note server names, my email address, ip's been changed.

I viewed the same message through thunderbird(so it still the same gmail address) and I got the same looking html with all those funny characters.

Now I sent it to another email address that is setup with exchange and viewed through outlook 2010.

<html>
<head>
    <title></title>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
</head>
<body style="font-size: 1em;">
        <img src="http://mysite.com/Content/Images/sitelogo.png" alt="mysite Logo" style="width: 231px; height: 63px;" />

    <div>

<h2>TestEmail</h2>


    </div>
    <div> Mailer Footer</div>
</body>

</html>

Why does it look normal in outlook 2010 but not gmail/thunderbird?

Edit

Here is one from staples

Delivered-To: [email protected]
Received: by 14.227.5.217 with SMTP id w57cs20187wes;
        Wed, 22 Jun 2011 09:56:05 -0700 (PDT)
Received: by 11.132.41.10 with SMTP id v10mr221945wfv.185.1308761763097;
        Wed, 22 Jun 2011 09:56:03 -0700 (PDT)
Return-Path: <[email protected]>
Received: from mta734.e.staples.com (mta734.e.staples.com [38.117.148.114])
        by mx.google.com with SMTP id m3si4122907icx.82.2011.06.44.09.50.02;
        Wed, 22 Jun 2011 09:56:03 -0700 (PDT)
Received-SPF: pass (google.com: domain of [email protected] designates 38.137.148.134 as permitted sender) client-ip=34.107.118.125;
DomainKey-Status: good (test mode)
Authentication-Results: mx.google.com; spf=pass (google.com: domain of [email protected] designates 38.117.148.122 as permitted sender) [email protected]; domainkeys=pass (test mode) [email protected]
DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws;
  s=200505; d=e.staples.ca;
  b=Ea8rCw0vzifMnnDucyEP7U7dnIz1GZ80sb9XKhvzHr3Qa+iIAQjtX0PT+W0HrNTU2hPumPnz1GOC1irFMNvx8eYPeLqJvk1l6BXms4VQVPMsAe/a6RYM50vVbxWOq0msmtMzVx5YhQbMhMl9XqlhR/czwlzJ0GJjbtoMbEHwU0Y=;
 h=Date:Message-ID:List-Unsubscribe:From:To:Subject:MIME-Version:Reply-To:Content-type;
Date: Wed, 22 Jun 2011 16:56:24 -0000
Message-ID: <bwff20ebg7m4p3au641sjqcgt5vvs6.14705389806.671@mta734.e.staples.ca>
List-Unsubscribe: <mailto:[email protected]>
From: "Staples" <[email protected]>
To: [email protected]
Subject: Summer Hot Buys!
MIME-Version: 1.0
Reply-To: "Staples" <[email protected]>
Content-type: multipart/alternative; boundary="=bwff20ebg7m4p3au641sjqcgt5vvs6"


--=bwff20ebg7m4p3au641sjqcgt5vvs6
Content-Type: text/plain; charset="iso-8859-1"
Content-transfer-encoding: 8bit

I am not sure why it says text/plain since it is using html.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

我三岁 2024-11-23 16:21:08

有趣的字符只是电子邮件正文的编码方式,以避免在传输过程中被破坏,正如信封中的 content-transfer-encoding 标头所指定的那样。 Outlook 向您显示已解码的邮件源,但仍然是源,而 GMail 和 Thunderbird 则为您提供源的“原始”视图。在这种情况下,使用的编码称为 quoted-printable

The funny characters are just the way the e-mail body is encoded to avoid getting mangled in transport, as the content-transfer-encoding header in the envelope specifies. Outlook shows you the decoded message source, but still the source, whereas GMail and Thunderbird give you a "raw" view of the source. In this case, the encoding used is called quoted-printable.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文