Sunday, February 08, 2009

Emails with inline Images

If you want to send a Email with an image inline, you can do that from Outlook or many other mail clients supports that. However if you send the mail programatically how do you do that?
1) Attach the image with the mail using MIME content type "multipart/related".
2) Set "Content-Id" header (eg Content-Id="image1")
3) In the HTML body of the email, include the image by

Reference: http://java.sun.com/developer/EJTechTips/2004/tt0625.html#1
http://www.ietf.org/rfc/rfc2387.txt

No comments: