Solved

Images within HTML emails (for a mac)

Posted on 2011-03-16
7
335 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
Back Up Your Microsoft Windows Server®

Back up all your Microsoft Windows Server – on-premises, in remote locations, in private and hybrid clouds. Your entire Windows Server will be backed up in one easy step with patented, block-level disk imaging. We achieve RTOs (recovery time objectives) as low as 15 seconds.

 

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

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

Finding original email is quite difficult due to their duplicates. From this article, you will come to know why multiple duplicates of same emails appear and how to delete duplicate emails from Outlook securely and instantly while vital emails remai…
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?
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…
CodeTwo Sync for iCloud (http://www.codetwo.com/sync-for-icloud?sts=6554) automatically synchronizes your Outlook 2016, 2013, 2010 or 2007 folders with iCloud folders available via iCloud Control Panel. This lets you automatically sync them with…

828 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