电子邮件中的不同内容类型 [英] Different Content Types in email

查看:127
本文介绍了电子邮件中的不同内容类型的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在查看发送给我的一些电子邮件的来源,发现其中一个部分的内容类型不同于HTML部分-见下文.

I was reviewing the source of some emails sent to me and noticed in one that the content type for the text part is different from the HTML part - see below.

--_----------=_MCPart_1153762294
Content-Type: text/plain; charset="us-ascii";

--_----------=_MCPart_1153762294
Content-Type: text/html; charset="utf-8"
Content-Transfer-Encoding: quoted-printable

我想知道是否可以这样做?该电子邮件是通过MailChimp服务器从Monkey Wrench发送的.

I was wondering if this is okay to have this? The email was sent from Monkey Wrench via MailChimp server.

推荐答案

要完全回答您的问题,有必要查看完整的标题和正文,但是鉴于我们拥有的内容:是的,可以做到这一点.消息本身可能是multipart,这些是消息正文中两个部分的摘要.

Seeing the complete headers and body would be necessary to fully answer your question, but given what we have: Yes, it's okay to have this. Presumably the message itself is multipart, and these are snippets from two of the parts in the message body.

这是我无耻地偷走的更完整的消息(来自:发送使用"mutt" 的HTML页面作为电子邮件.它包含了您提到的所有部分,如果过于简单的话,它是完全合法的:

Here's a more complete message that I shamelessly stole (from: Send Html page As Email using "mutt"). It includes all the parts you mention, and it is perfectly legit if somewhat simplistic:

Subject: test html mail
From: sender@example.com
To: recipient@example.com
Content-Type: multipart/alternative; boundary=bcaec520ea5d6918e204a8cea3b4

--bcaec520ea5d6918e204a8cea3b4
Content-Type: text/plain; charset=ISO-8859-1

*hi!*

--bcaec520ea5d6918e204a8cea3b4
Content-Type: text/html; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable

<p><b>hi!</b></p>

--bcaec520ea5d6918e204a8cea3b4--

这篇关于电子邮件中的不同内容类型的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆