SuccessInMind wrote:
> 
> Hi,
> 
> Given that this perl code will send a TEXT attachement how can I
> modify this coe to send GIF image instead?
> 
>   open (MAIL, "|$mailprog -oi -t");
>   print MAIL "From: $admin\n";
>   print MAIL "To: $admin\n";
>   print MAIL "Subject: The image you have order\n";
> 
>   print MAIL "MIME-Version: 1.0\n";
>   print MAIL "Content-Type: multipart/mixed;
> "."boundary=\"8=--\"\n";
>   print MAIL "\n";
>   print MAIL "--8=--\n";
>   print MAIL "\n";
>   print MAIL "$body\n";
>   print MAIL "\n";
>   print MAIL "--8=--\n";
>   print MAIL "Content-Type: text/plain; ".
> "charset=us-ascii\n";   print MAIL "Content-Disposition:
> attachment; ".    "filename=\"myfile.txt\"\n";
>   print MAIL "\n";
>   if (open FILE,"<$myfile") {
>     while (<FILE>) { print MAIL }
>     close FILE;
>   }
>   print MAIL "\n";

I would switch to MIME::Lite which handles that easily.  If for 
some reason you are unable to switch, you will need to change 
your content-type to image/gif and possibly base64 encode the 
image (although these days it may not be necessary - depends 
on your target client and intermediate gateways).

-- 
  ,-/-  __      _  _         $Bill Luebkert   ICQ=14439852
 (_/   /  )    // //       DBE Collectibles   Mailto:[EMAIL PROTECTED] 
  / ) /--<  o // //      http://dbecoll.webjump.com/ (Free site for Perl)
-/-' /___/_<_</_</_     Castle of Medieval Myth & Magic http://www.todbe.com/
_______________________________________________
Perl-Unix-Users mailing list. To unsubscribe go to 
http://listserv.ActiveState.com/mailman/subscribe/perl-unix-users

Reply via email to