Email and images

Posted on 2003-02-21
Medium Priority
Last Modified: 2013-11-24
How can I add an image as "invisible" attachment.
I mean: I want to email (through a html-message) a person, which will be personally but I want to add an image in my html-mail ?
How can I do this ?
The first solution i've found myself, but that's not what I want, because then the user has to be able to put a picture an a "webspace" to link it to my message.
I read a lot about using cid, but I don't know how to do it.
I make my mail in visual basic
Question by:Dhaest
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions

Expert Comment

ID: 7992571
I do hope this is impossible and stays impossible with most clients (Lotus Notes will be an exception like always).  Otherwise we will be flodded with Spam in this style.
Use a normal Text mail and Mime attachments. That's the normal way. Everything else is a hack and unrelayable.

Expert Comment

ID: 7993425
Hi there,

to embed your image and not having it shown as attachment create the mail this way:

1. Setting the MIME-type
Setting the MIME-Type to "multipart/related" tells the mailclient that the single MIME-Parts are in relation to each other.

2. Create the HTML-Mail
Generate your Mail-Body using HTML and include the images with the "cid"-Magic you've already heard of:

This ist your image:<img src="cid:image.gif"/>

3. Attach the image
Your image has to be included as a MIME-Part for your Message. Set the header "Content-ID" to "image.gif". (As you might have guessed, Content-ID equals cid). The image is best included in byse64-encoding. Resulting MIME-Part should look like this:

Content-Type: image/gif; name="image.gif"
Content-ID: image.gif
Content-Transfer-Encoding: base64


I've done this with PHP and JavaMail already. Mailclients that i found to work are Outlook(Express) and Notes 5 (as long as HTML-Mail is enabled)

Hope that helps,


P.S.: If you have OutlookExpress you can create these kind of mail (with insert image). After sending it to yourself have a look at the message sourcecode (somewhere at File/Properties/Details/Sourcecode).
LVL 53

Author Comment

ID: 8261193
i've found the solution by myself, so i will let this question close
The solution:

Accepted Solution

SpideyMod earned 0 total points
ID: 8261359
PAQ'd and all 300 points refunded.

Community Support Moderator @Experts Exchange

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In this post we will learn how to make Android Gesture Tutorial and give different functionality whenever a user Touch or Scroll android screen.
The SignAloud Glove is capable of translating American Sign Language signs into text and audio.
Simple Linear Regression
Six Sigma Control Plans

762 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question