Message127161
When attaching a subpart to a multipart message, python should follow the recomendations of the rfcs and remove the MIME-Version header of each part, leaving only one MIME-Version header at the beggining of the message.
>>> from email.mime.multipart import MIMEMultipart
>>> from email.mime.text import MIMEText
>>> usermail=MIMEMultipart('alternative')
>>> part=MIMEText('text')
>>> print part
From nobody Thu Jan 27 00:33:50 2011
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
text
>>> usermail.attach(part)
>>> print usermail
From nobody Thu Jan 27 00:45:26 2011
Content-Type: multipart/alternative; boundary="===============1006894803=="
MIME-Version: 1.0
--===============1006894803==
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
text
--===============1006894803==-- |
|
Date |
User |
Action |
Args |
2011-01-26 23:47:25 | david.caro | set | recipients:
+ david.caro |
2011-01-26 23:47:25 | david.caro | set | messageid: <1296085645.01.0.978524639714.issue11021@psf.upfronthosting.co.za> |
2011-01-26 23:47:24 | david.caro | link | issue11021 messages |
2011-01-26 23:47:24 | david.caro | create | |
|