I'm trying to use the following snippet:
http://djangosnippets.org/snippets/2661/#c4539
But I encountered some errors
1 ) i cannot import MIMEImage form email. I get an error: No module named MIMEImage
UPDATE: I had a file named email.py. Don't use file names that have the same name as Python standard library modules. Also don't forget to delete the hidden file named email.pyc in this case
2 ) I don't understand how to use this with Django's EmailMessage class. The following error shows: 'NoneType' object has no attribute 'body' when using:
from django.core.mail.message import EmailMessage
from emails import localize_html_email_images
mail = EmailMessage('Hoi', template, 'from@example.com', headers={'Reply-To': 'another@example.com'})
email = localize_html_email_images(mail
3 ) is this a good way to send html emails with images or are there other ways to do it (without installing other packages)?
What i'm trying to achieve is sending an activation email with a button to activate. The button has to be an image attached to the email.