[Chicago-talk] sending images with Mime::Lite

imran javaid imranjj at gmail.com
Fri Apr 8 09:09:50 PDT 2011


Try this (note the cid in the img src):

my $msg = MIME::Lite->new(
         From    => 'richard at rushlogistics.com',
         To      => $email,
         Subject => "HTML email test",
         Type    =>'multipart/related'
);

my $gif = "/home/richard/gator_head.gif";
my $message = '<img src="cid:'.basename($gif).'" alt="Image should be
here."/>
Please visit our site <a href="http://savethegators.org/">online</a><hr>';

$msg->attach(
        Type => 'text/html',
        Data =>  $message,
);
$msg->attach(
        Type => 'image/gif',
        Id   => basename($gif),
        Path => $gif,
);


On Fri, Apr 8, 2011 at 11:00 AM, Richard Reina <richard at rushlogistics.com>wrote:

> I am trying to send an email with an image in the signature but when I do
> the image does not show up.  Can anyone tell me what I am doing wrong?
>
> # create a new MIME Lite based email
> my $msg = MIME::Lite->new
> (
> Subject => "HTML email test",
> From    => 'richard at rushlogistics.com',
> To      => $email,
> Type    => 'text/html',
> Data    => '<img src="/home/richard/gator_head.gif" alt="Image should be
> here."/>
> Please visit our site <a href="http://savethegators.org/">online</a><hr>'
> );
> --
> Richard Reina
> Rush Logistics, Inc.
> Watch our 3 minute movie:
> http://www.rushlogistics.com/movie
>
> _______________________________________________
> Chicago-talk mailing list
> Chicago-talk at pm.org
> http://mail.pm.org/mailman/listinfo/chicago-talk
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.pm.org/pipermail/chicago-talk/attachments/20110408/3723448f/attachment.html>


More information about the Chicago-talk mailing list