Problem sending an email in html with mime image

A

Ariel

Hi everybody I have a question, here is my problem I want to send an
email with content in html with an image embed so I converted the
image binary in mime text and then I put the mime code inside the src
attribute of the html like this:

<img class="logoeeeee" src="data:image/jpeg;base64,/9j/4QAYRXhpZgAASUkq ... " />

Then I send the email, here is my code:

from django.template.loader import render_to_string
from django.core.mail.message import EmailMultiAlternatives

contextcopy = {}
message = render_to_string('bulletin.html', contextcopy)
subject = "TEST"
msg = EmailMultiAlternatives(subject, message,
from_email,['(e-mail address removed)''])
msg.attach_alternative(message, "text/html")
msg.send()

The problem is that if I don't put the image mime code inside the src
the email is sent but when I put the code then the email is not send
and I don't get any error message.

Could somebody please, help me ???
Why the email is not send when I put the mime code of the image in the html ???

Regards,
Ariel
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,755
Messages
2,569,537
Members
45,022
Latest member
MaybelleMa

Latest Threads

Top