在Django中(與Python)的Python/Django的MIME多的電子郵件,我怎麼可以構建如下所示的電子郵件:利用邊界
我需要的是開頭的電子郵件:
Content-Type: multipart/alternative;
boundary="=_5f8686714d769f9476ce778798b84ff4"
邊界是把純文本的地方:
--=_5f8686714d769f9476ce778798b84ff4
Content-Type: text/plain; charset="ISO-8859-1"
Content-Transfer-Encoding: 7bit
This e-mail is in HTML-format. Click the following link:
http://www.company.nl/enews/7
--=_5f8686714d769f9476ce778798b84ff4
之後,我需要的相關內容塔伊:
Content-Type: multipart/related;
boundary="=_e49477d06c604958b9b2bc038628a26f"
邊界是將HTML
--=_e49477d06c604958b9b2bc038628a26f
Content-Type: text/html; charset="ISO-8859-1"
Content-Transfer-Encoding: quoted-printable
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.= w3.org/TR/html4/loose.dtd"> <html style=3D"height: 100%"> <head>/head> <body></body> </html>
--=_e49477d06c604958b9b2bc038628a26f
最終,它看起來像這樣的地方:
Received: (qmail 6116 invoked by uid 48); 16 Jul 2012 18:00:49 +0200
Date: 16 Jul 2012 18:00:49 +0200
To: [email protected]
Subject: Something
MIME-Version: 1.0
From: Company <[email protected]>
Content-Type: multipart/alternative;
boundary="=_5f8686714d769f9476ce778798b84ff4"
Message-ID: <[email protected]>
--=_5f8686714d769f9476ce778798b84ff4
Content-Type: text/plain; charset="ISO-8859-1"
Content-Transfer-Encoding: 7bit
This e-mail is in HTML-format. Click the following link:
http://www.company.nl/enews/7
--=_5f8686714d769f9476ce778798b84ff4
Content-Type: multipart/related;
boundary="=_e49477d06c604958b9b2bc038628a26f"
--=_e49477d06c604958b9b2bc038628a26f
Content-Type: text/html; charset="ISO-8859-1"
Content-Transfer-Encoding: quoted-printable
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.=
w3.org/TR/html4/loose.dtd">
<html style=3D"height: 100%">
<head>/head>
<body></body>
</html>
--=_e49477d06c604958b9b2bc038628a26f
我試圖與Django的EmailMessage(替代),蟒蛇MimeMultipart的,但我可以」沒有按照確切的順序。