pmclanahan/django-celery-email

Attachments headers not working in 2.0.0

Opened this issue · 0 comments

F0x06 commented

Hi, my attachments headers are stripped when i try to send an e-mail.

django-celery-email: 2.0.0
Django: 1.11.6
Python: 3.6.2

mail = EmailMultiAlternatives(
    'TestMail',
    'Hello World',
    'no-reply@test.com',
    'john.doe@domain.tld'
)

html = "Some html template with cid:..."

mail.attach_alternative(html, "text/html")
mail.mixed_subtype = 'related'
image_data = open(......)
image_name = "image.png"

# Image
msg_img = MIMEImage(image_data)
msg_img.add_header('Content-ID', '<{}>'.format(image_name))
mail.attach(msg_img)

mail.send()

Thanks in advance.