纯文本电子邮件和仅包含纯文本的多部分电子邮件之间有区别吗?
我正在使用 Rails 发送电子邮件,并且只想发送纯文本电子邮件(没有相应的 HTML 部分)。
我注意到,如果我只有一个名为 email.text.plain.erb
的文件,它实际上会生成一封多部分电子邮件,其中一部分(纯文本部分)如下所示:
Content-Type: multipart/alternative; boundary=mimepart_4c04a2d34c4bb_690a4e56b0362
--mimepart_4c04a2d34c4bb_690a4e56b0362
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: Quoted-printable
Content-Disposition: inline
text of the email here...
--mimepart_4c04a2d34c4bb_690a4e56b0362--
但是如果我取出text.plain
部分并将其命名为 email.erb
ActionMailer 会生成一封没有多部分的常规纯文本电子邮件,如下所示:
Content-Type: text/plain; charset=utf-8
text of the email here...
两者在大多数情况下都工作正常(所以这有点挑剔),但我想我的问题是第二个是否更正确。我的目标只是确保在各种设备和电子邮件客户端上尽可能高的送达率。
我读过,纯文本电子邮件的送达率比 html 略高,我很好奇加入这个多部分(即使它只包含纯文本部分)是否可能会甩掉一些较笨的电子邮件客户端。感谢您的帮助!
I'm using Rails to send emails and I just want to send a plain text email (there is no corresponding HTML part).
I've noticed that if I just have one file named email.text.plain.erb
it actually generates a multipart email with one part (the plain text part) like this:
Content-Type: multipart/alternative; boundary=mimepart_4c04a2d34c4bb_690a4e56b0362
--mimepart_4c04a2d34c4bb_690a4e56b0362
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: Quoted-printable
Content-Disposition: inline
text of the email here...
--mimepart_4c04a2d34c4bb_690a4e56b0362--
But if I take out the text.plain
part and name it email.erb
ActionMailer generates a regular plain text email without multipart like this:
Content-Type: text/plain; charset=utf-8
text of the email here...
Both work fine most of the time (so this is kind of nitpicky), but I guess my question is whether the second one is more correct. My goal here is just to make sure deliverability is as high as possible across a wide variety of devices and email clients.
I've read that plain text emails can have slightly better deliverability rates than html and was just curious if throwing in this multipart (even if it only contained a plain text part) might throw off some of the dumber email clients. Thanks for your help!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
这些天不太可能产生影响。过去,存在根本不支持多部分消息的电子邮件客户端,但现在它们都支持:即使只是剥离 HTML 并仅显示纯文本。
从节省几个字节的角度来看,发送纯文本是件好事,但我认为否则不会有什么坏处。
It's unlikely to have an affect these days. It used to be that there existed email clients that didn't support multi-part messages at all, but today they all do: even if it's just to strip off the HTML and display only the plain text.
It's good to just send the plain text from the point of view that you're saving a few bytes, but I don't imagine it would hurt otherwise.
我会选择第二名。虽然现在大多数电子邮件软件都能很好地处理多部分消息,但将纯文本电子邮件包装成单独的部分却一无所获。
I'd go for number two. While most email software handle multipart messages just fine these days, you gain nothing by wrapping a plain text email into a separate part.