Re: Embedding multiple images in html email

2009-10-15 Thread Tim Chase

> Can't you include the link and source within the html code of the email?

The problem then becomes that many email programs no longer 
display remote images inline unless the email comes from a 
trusted source.  It was a popular way to add tracking bugs to 
HTML emails, so MUAs began to disable the functionality.  To get 
around it, you have to include the image in the HTML-email itself 
as a named attachment, and then reference it with  as described at[1]

Don't forget that some folks fly with HTML email turned off or 
from mobile devices that may not support HTML email, so they will 
only see the plain-text version which you'll want to include. 
The images and HTML version will likely appear merely as attachments.

-tim

[1]
http://code.activestate.com/recipes/473810/




--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: Embedding multiple images in html email

2009-10-15 Thread Angel Cruz
Can't you include the link and source within the html code of the email?

for example, as a snippet:
.
.
.
html = """\

  
  blah blah blah
   
http://blah-blah-blah.com";>http://blah-blah-blah.com/media/img/blah-blah-whatver-image.png";
width=100%>

Blah-whatever-your-message-here




"""

# Record the MIME types of both parts - text/plain and text/html.
part1 = MIMEText(text, 'plain')
part2 = MIMEText(html, 'html')

# Attach parts into message container.
# According to RFC 2046, the last part of a multipart message, in this
case
# the HTML message, is best and preferred.
msg.attach(part1)
msg.attach(part2)

s = smtplib.SMTP(blah-blah-whatever-MY_SMTP_SERVER)
# sendmail function takes 3 arguments: sender's address, recipient's
address
# and message to send - here it is sent as one string.
s.sendmail(me, myRecipient, msg.as_string())
s.quit()
.
.
.

Since it is html, you can embed as many images as you want?

On Thu, Oct 15, 2009 at 5:30 AM, Muhammed Abad wrote:

>
> As the topic says, can I embed multiple images in an html email
> template so the recipient does not have to download them?
>
> I know this might be a silly request, but a client has asked me to do
> this for him and Im absolutely stumped.
>
> The closest to a solution I have come to is this :
> http://www.djangosnippets.org/snippets/1507/
>
> If someone else can get this to work, please let me know.
>
> Any other solution are welcome.
>
> Thanks in advance.
>
> M.
>
> >
>

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Embedding multiple images in html email

2009-10-15 Thread Muhammed Abad

As the topic says, can I embed multiple images in an html email
template so the recipient does not have to download them?

I know this might be a silly request, but a client has asked me to do
this for him and Im absolutely stumped.

The closest to a solution I have come to is this :
http://www.djangosnippets.org/snippets/1507/

If someone else can get this to work, please let me know.

Any other solution are welcome.

Thanks in advance.

M.

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---