Solved

Images within HTML emails (for a mac)

Posted on 2011-03-16
7
333 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
Comprehensive Backup Solutions for Microsoft

Acronis protects the complete Microsoft technology stack: Windows Server, Windows PC, laptop and Surface data; Microsoft business applications; Microsoft Hyper-V; Azure VMs; Microsoft Windows Server 2016; Microsoft Exchange 2016 and SQL Server 2016.

 

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

Enterprise Mobility and BYOD For Dummies

Like “For Dummies” books, you can read this in whatever order you choose and learn about mobility and BYOD; and how to put a competitive mobile infrastructure in place. Developed for SMBs and large enterprises alike, you will find helpful use cases, planning, and implementation.

Question has a verified solution.

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

Suggested Solutions

This article discusses four methods for overlaying images in a container on a web page
Is your Office 365 signature not working the way you want it to? Are signature updates taking up too much of your time? Let's run through the most common problems that an IT administrator can encounter when dealing with Office 365 email signatures.
The viewer will receive an overview of the basics of CSS showing inline styles. In the head tags set up your style tags: (CODE) Reference the nav tag and set your properties.: (CODE) Set the reference for the UL element and styles for it to ensu…
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 …

863 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

Need Help in Real-Time?

Connect with top rated Experts

20 Experts available now in Live!

Get 1:1 Help Now