Solved

Images within HTML emails (for a mac)

Posted on 2011-03-16
7
334 Views
Last Modified: 2012-08-13
I have an Access database that can send out basic, html emails (via CDO, on a PC).  This works fine when receiving an email on a PC, but when sent to a mac the images are not where they should be (they are at the bottom of the screen). The image then has a ? place holder instead.

To insert the image into the html file I use something like:

<img src="Image.JPG" width="200" height="87" />

and then attach the image file to the email.

Is there a better way (I'm sure there is)????
0
Comment
Question by:Andy Brown
  • 4
  • 3
7 Comments
 
LVL 8

Accepted Solution

by:
et01267 earned 500 total points
ID: 35149970
You need to create multipart MIME messages

The part with the image needs to have a header like this:

Content-Type: image/jpeg; x-mac-type="0"; x-mac-creator="0";
 name="IMG_0055.jpg"
Content-Transfer-Encoding: base64
Content-ID: <something-unique>
Content-Disposition: inline;
 filename="IMG_0055.jpg"

and then you reference the image in the body of the message like this

<img src="cid:something-unique">

0
 

Author Comment

by:Andy Brown
ID: 35150520
Thank you for this - really appreciated.  Just a couple of things.

1) Is this script put into the HTML page sent
2) Will have any affect on the PC version (which seems to work ok)?

Thanks again.
0
 
LVL 8

Expert Comment

by:et01267
ID: 35151075
I'm not sure what you are asking in (1).  

If you are asking about the HTML email body, then I guess you need to embed the <img> tag inside whatever element you have to contain it like a <div> or a <table> or whatnot.

If you are asking about the MIME headers, they need to go at the top of the part containing the image, right after the magic divider that separates the parts (looks like "--------------070506030601060606090504
", for example).

But your email sender must have the ability to formulate multipart MIME and have ways of setting the header values, right?

For (2), as long as you have a valid multipart MIME message then the PC should read it correctly.
0
U.S. Department of Agriculture and Acronis Access

With the new era of mobile computing, smartphones and tablets, wireless communications and cloud services, the USDA sought to take advantage of a mobilized workforce and the blurring lines between personal and corporate computing resources.

 

Author Comment

by:Andy Brown
ID: 35151344
Brilliant - does anyone have any hyperlinks to a basic example that I can draw from?
0
 
LVL 8

Expert Comment

by:et01267
ID: 35151451
I've attached an email I composed on my mail program with an image embedded
test.txt
0
 

Author Comment

by:Andy Brown
ID: 35154673
Ahh, it looks like I need to do a little more reading.  Creating the html content and sending it as an email is easy, however, converting the image files to a MIME type and then how to place them has completely stumpped me.
0
 

Author Closing Comment

by:Andy Brown
ID: 35154921
Thank you so much for your help on this.  I am going to re-word this post and see if I can get any further, but the fact that you pointed me into the MIME direction was a big help.

Thanks again.
0

Featured Post

Three Reasons Why Backup is Strategic

Backup is strategic to your business because your data is strategic to your business. Without backup, your business will fail. This white paper explains why it is vital for you to design and immediately execute a backup strategy to protect 100 percent of your data.

Question has a verified solution.

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

Have you tried to learn about Unicode, UTF-8, and multibyte text encoding and all the articles are just too "academic" or too technical? This article aims to make the whole topic easy for just about anyone to understand.
As tax season makes its return, so does the increase in cyber crime and tax refund phishing that comes with it
HTML5 has deprecated a few of the older ways of showing media as well as offering up a new way to create games and animations. Audio, video, and canvas are just a few of the adjustments made between XHTML and HTML5. As we learned in our last micr…
The viewer will learn how to create a basic form using some HTML5 and PHP for later processing. Set up your basic HTML file. Open your form tag and set the method and action attributes.: (CODE) Set up your first few inputs one for the name and …

803 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