Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium


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

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

Upgrade your Question Security!

Your question, your audience. Choose who sees your identity—and your question—with question security.

Question has a verified solution.

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

Today, the web development industry is booming, and many people consider it to be their vocation. The question you may be asking yourself is – how do I become a web developer?
If you are a mobile app developer and especially develop hybrid mobile apps then these 4 mistakes you must avoid for hybrid app development to be the more genuine app developer.
In this fourth video of the Xpdf series, we discuss and demonstrate the PDFinfo utility, which retrieves the contents of a PDF's Info Dictionary, as well as some other information, including the page count. We show how to isolate the page count in a…
With the power of JIRA, there's an unlimited number of ways you can customize it, use it and benefit from it. With that in mind, there's bound to be things that I wasn't able to cover in this course. With this summary we'll look at some places to go…

578 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