Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.python > #19740 > unrolled thread
| Started by | Ariel <isaacrc82@gmail.com> |
|---|---|
| First post | 2012-02-01 16:24 -0500 |
| Last post | 2012-02-02 21:14 -0800 |
| Articles | 2 — 2 participants |
Back to article view | Back to comp.lang.python
Problem sending an email in html with mime image Ariel <isaacrc82@gmail.com> - 2012-02-01 16:24 -0500
Re: Problem sending an email in html with mime image Tim Roberts <timr@probo.com> - 2012-02-02 21:14 -0800
| From | Ariel <isaacrc82@gmail.com> |
|---|---|
| Date | 2012-02-01 16:24 -0500 |
| Subject | Problem sending an email in html with mime image |
| Message-ID | <mailman.5323.1328131467.27778.python-list@python.org> |
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,['myemail@gmail.com''])
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
[toc] | [next] | [standalone]
| From | Tim Roberts <timr@probo.com> |
|---|---|
| Date | 2012-02-02 21:14 -0800 |
| Message-ID | <87rmi7pc0b3g2f901re67v6vkb0f0ro0lp@4ax.com> |
| In reply to | #19740 |
Ariel <isaacrc82@gmail.com> wrote: > >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 ... " /> Do email readers actually implement the data: scheme in <img> tags? >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. There must be something else going on. The content of the message is irrelevant to the sending process, unless it makes your message way too big. -- Tim Roberts, timr@probo.com Providenza & Boekelheide, Inc.
[toc] | [prev] | [standalone]
Back to top | Article view | comp.lang.python
csiph-web