vroom has asked for the
wisdom of the Perl Monks concerning the following question:

Hi I'm currently working on sending an HTML e-mail with inline images using Mail::Sender and running into problems. I can get the images to show up fine in Outlook but when I print the messages the images show up as the "not found" x's.

The code below is mostly shamelessly cut from the Mail::Sender docs. Also different clients seem to handle
the results very differently. I'm looking for any insight into this particular problem, or best practices for getting this to work in *most* clients.

You might want to use MIME::Lite instead. Here is some code (that I also shamelessly lifted from the docs). It viewed and printed correctly using Outlook Express. I liked the module installation and 'feel' of the code better too:

Well, a couple minor things. Firstly, you didn't include the HTML file you use (file.html), which can make a difference. The problem might lie there. Specifically, with the syntax of the src="cid:img" references.

Also, you're manually embedding one header (Content-ID) within another. It should work the way you have it, but it is "more correct" to use the content_id parameter to Attach (see code below).

And though I'm sure it doesn't make any difference to the problem, you're giving the wrong content-type for the jpeg ('image/gif' instead of 'image/jpeg').

Here is your code, slightly modified and formatted, and the html file I used. It seems to work for me, though I don't actually have Outlook to test it with. As far as I can tell, this is "correct", though, so it should work the same with Outlook as with my email client (PocoMail). If this doesn't work with Outlook, then I can only assume the problem is with Outlook and printing inline images. Perhaps you could try it in another mail client to see if it's an Outlook-specific issue.

Update: There is a Knowledge Base Article (#287768) about this issue. You should check that to see if it's the same problem.

i was trying the same thing, and typed your code in and i can't get any of the images in the outlook email.
they seem to be files, in the body of the email.
in ms express they show up fine.
is there a setting in Outlook that i should set?
thanks in advance!