I’m using http://code.google.com/p/django-email-extras/ to generate rich email content.
I have trouble in sending email with image included.
I put this line in my template
<img border="0" src="{{ image.url }}">
Sending email python script
# put everything to dictionary
dict = {'image': image,}
# send email
send_mail_template(subject, 'confirm', '', request.user.email, fail_silently=False, attachments=None, context=dict)
I’m very sure {{ image.url }} is correct. I don’t know why the image wasn’t shown in the email, absolutely I activated “Display image” in my mailbox.
Please help me.
{{ image.url }} will most likely return something like
/site_media/media/mypicture.jpeg This is not sufficient. For emails you need to include the domain address also.
What does the raw html look like in the email? The src url should be similar to “http://www.mydomain.com/{{image.url}}/ ” in the document.