Attachment not displayed when sending email
The attachments of emails send with Email.send
are not displayed because they are in a multipart/alternative
.
This is because we use MIMEMultipart('mixed')
as main message which is wrong.
We should use EmailMessage
everywhere as base of the message as it is available since Python 3.4.
The only drawback (and backward incompatibility) is that setting Subject
with Header
does not work because EmailMessage
do it automatically. But I think it worth it to fix emails in every series.