http://www.perlmonks.org?node_id=240230


in reply to Sending Inline Images in e-mail with Mail::Sender (or getting them to print in Outlook)

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:
use strict; use warnings; use MIME::Lite; my $msg = MIME::Lite->new( To =>'someone@somewhere.net', Subject =>'HTML with in-line images!', Type =>'multipart/related' ); $msg->attach(Type => 'text/html', Data => qq{ <body> Here's <i>my</i> image: <img src="cid:myimage.gif"> </body> } ); $msg->attach(Type => 'image/gif', Id => 'myimage.gif', Path => '/some/path/myimage.gif', ); $msg->send();
Update: It also views/prints correctly under Mozilla 1.2.1

--Jim

  • Comment on Re: Sending Inline Images in e-mail with Mail::Sender (or getting them to print in Outlook)
  • Download Code