simple example of mimelib? and embedding (not attaching) images in email sent with python.

Tim Roberts timr at probo.com
Wed Aug 15 01:09:11 EDT 2001


shriek at gmx.co.uk (Stephen) wrote:

>I've looked through the archives regarding using smtplib and the 
>numerous MIME related modules for sending email messages with attachments.  
>I've found various solutions, some of which no longer seem to work, and 
>was quite surprised how this seemingly banal task has caused so much trouble. 
>However, in Microsoft Outlook, it's possible to embed image files into
>the actual message as opposed to having them attached.  This way, they 
>display when the recipient views the message.

Note, however, that the standards for HTML formatted e-mail are still
evolving.  Messages with image attachments in Outlook generally only look
right when viewed in Outlook.

You build your message with MIME type multipart/related.  You put the HTML
text in a text/html part, and then use a series of image/gif attachments to
hold the images.

Chek RFC2557 at http://www.ietf.org/rfc/rfc2557.txt
--
- Tim Roberts, timr at probo.com
  Providenza & Boekelheide, Inc.



More information about the Python-list mailing list