pmclanahan / django-celery-email

A Django email backend that uses a celery task for sending the email.
BSD 3-Clause "New" or "Revised" License
477 stars 108 forks source link

Attachments headers not working in 2.0.0 #46

Open F0x06 opened 7 years ago

F0x06 commented 7 years ago

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.