Email and images

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
LVL 53
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

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.
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).
DhaestAuthor Commented:
i've found the solution by myself, so i will let this question close
The solution:
PAQ'd and all 300 points refunded.

Community Support Moderator @Experts Exchange

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Java EE

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.