【发布时间】:2011-10-31 16:46:51
【问题描述】:
我从我的 ruby on rails 应用程序发送电子邮件。所有电子邮件客户端都可以正常显示我的电子邮件(gmail、bat、thunderbird 等),但 Outlook 不能:(
在前景中我看到了这个:
my message text
--mimepart_4e514d8786c25_d59..fdab8042069c
Content-Type: multipart/related; charset=f-8
Content-Transfer-Encoding: Quoted-printable
Content-Disposition: inline
--mimepart_4e514d8786c25_d59..fdab8042069c
Content-Type: text/plain; charset=f-8
Content-Transfer-Encoding: Quoted-printable
Content-Disposition: inline
my email text message
--mimepart_4e514d8786c25_d59..fdab8042069c
Content-Type: text/html; charset=f-8
Content-Transfer-Encoding: Quoted-printable
Content-Disposition: inline
my email html code (<h1>test</h1><table...)
--mimepart_4e514d8786c25_d59..fdab8042069c--
怎么了???
以防万一来自 Outlook 的标题:
Message-Id: <4e514d88.100fdf0a.403c.31a7@mx.xxx.ccc>
Subject: =?utf-8?Q?=D0=97=D0=B0=D0=BF=D1=80=D0=BE=D1=81_=D0=B4=D0=BB=D1=8F_=D0=BC=D0=B5=D0=BD=D0=B5=D0=B4=D0=B6=D0=B5=D1=80=D0=B0_=D0=BA=D0=BE=D0=BC=D0=BF=D0=B0=D0=BD=D0=B8=D0=B8_?=
Mime-Version: 1.0
Content-Type: multipart/alternative; boundary=mimepart_4e514d8786c25_d59..fdab8042069c
User-Agent: Rails Application
X-Mailer: Rails Mailer
Return-Path: admin@xxx.ccc
X-Yandex-Forward: 8a20ef6ffc7eeb7ef7c8d000508718e0
来自 gmail 的同一封电子邮件,在文本和 html 模式下都显示良好:
Delive
Message-Id: <4e514d88.100fdf0a.403c.31a7@mx.xxx.com>
Subject: xxx
Mime-Version: 1.0
Content-Type: multipart/alternative; boundary=mimepart_4e514d8786c25_d59..fdab8042069c
User-Agent: Rails Application
X-Mailer: Rails Mailer
X-Yandex-Forward: 8a20ef6ffc7eeb7ef7c8d000508718e0
--mimepart_4e514d8786c25_d59..fdab8042069c
Content-Type: multipart/alternative; charset=utf-8
Content-Transfer-Encoding: Quoted-printable
Content-Disposition: inline
email text
--mimepart_4e514d8786c25_d59..fdab8042069c
Content-Type: multipart/related; charset=utf-8
Content-Transfer-Encoding: Quoted-printable
Content-Disposition: inline
--mimepart_4e514d8786c25_d59..fdab8042069c
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: Quoted-printable
Content-Disposition: inline
email text (plain text)
--mimepart_4e514d8786c25_d59..fdab8042069c
Content-Type: text/html; charset=utf-8
Content-Transfer-Encoding: Quoted-printable
Content-Disposition: inline
email text(html)
--mimepart_4e514d8786c25_d59..fdab8042069c--
【问题讨论】:
-
顶部的空多部分/相关替代方案有什么意义?我认为发送 multipart/* 类型的一部分而不为它定义内部分隔符并给它一个终止行是不合法的。
-
另外,
charset=f-8不为 IANA 字符集注册表所知。
标签: html ruby-on-rails email outlook