On Wed, Dec 04, 2002 at 12:20:28AM +0000, Alex McLintock said:
> I can handle the sort of email where it says "Someone has sent you an 
> electronic card, you can view it at this URL....."
> but what if I want to include the whole graphic in html email. Is there a 
> standard CPAN module for that? (I can send attachments - but am not sure I 
> understand how images are used in html email).

>From the MIME::Lite perldocs 


       Send an HTML document... with images included!

           $msg = MIME::Lite->new(
                        To      =>'[EMAIL PROTECTED]',
                        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 => '/path/to/somefile.gif',
                        );
           $msg->send();


Reply via email to