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

x
?
Solved

Email and images

Posted on 2003-02-21
4
Medium Priority
?
4,208 Views
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
0
Comment
Question by:Dhaest
4 Comments
 
LVL 1

Expert Comment

by:alexwms
ID: 7992571
Hy,
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.
Alexander
0
 
LVL 3

Expert Comment

by:NetWize
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:

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

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:

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

ABascde343242==


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,

Jan

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).
0
 
LVL 53

Author Comment

by:Dhaest
ID: 8261193
i've found the solution by myself, so i will let this question close
The solution:
http://www.slipstick.com/dev/code/htmlimg.htm
0
 

Accepted Solution

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

SpideyMod
Community Support Moderator @Experts Exchange
0

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