On Tue, 29 Jul 2003 14:37:51 +0530, [EMAIL PROTECTED] (Ramprasad) wrote: >Hello all, > > I am confused at using MIME::Parser and adding attachments >When I add an attachment thru MIME::Parser it is show as a seperate >attachment on all clients >But When I add an inline image thru a mail client I can see it in the >body of the mail > > >Can anyone tell me how to attach inline using MIME::Parser >Thanks >Ram
I don't know much about images with MIME::Parser, but if you use MIME::Lite it's easy to send inline pictures. The trick is the cid prefix, notice the ID field for the image, and in the html, the image name is prefixed with cid: Something similar is needed with MIME::Parser. #!/usr/bin/perl -w # Send HTML document with inline images use strict; use MIME::Lite; # Create a new MIME Lite object my $msg = MIME::Lite->new( From =>'[EMAIL PROTECTED]', To =>'[EMAIL PROTECTED]', Subject =>'Hi', Type =>'multipart/related'); # Add the body to your HTML message $msg->attach(Type => 'text/html', Data => qq{ <BODY BGCOLOR=#FFFFFF> <H2>Hi</H2> <P ALIGN="left"> This is an HTML message. </P> <P ALIGN="left"> <A HREF="http://foo123.com/">Here's a link</A>. </P> <P ALIGN="middle"> <IMG SRC="cid:2uni2.jpg"> </P> </BODY> }); # Attach the image $msg->attach(Type => 'image/jpg', Id => '2uni2.jpg', Path => '2uni2.jpg'); # Send it $msg->send(); -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]