in reply to Dealing with atachments.

For dealing with attachments use one of the perl MIME modules. I find that MIME::Lite has been strong-enough to do anything I've ever needed with attachments/multipart messages. Here's an example of its usage taken from the MIME::Lite documentation:
use MIME::Lite; # Create a new multipart message: $msg = new MIME::Lite From =>'me@myhost.com', To =>'you@yourhost.com', Cc =>'some@other.com, some@more.com', Subject =>'A message with 2 parts...', Type =>'multipart/mixed'; # Add parts (each "attach" has same arguments as "new"): attach $msg Type =>'TEXT', Data =>"Here's the GIF file you wanted"; attach $msg Type =>'image/gif', Path =>'aaa000123.gif', Filename =>'logo.gif';
Once you have your message constructed with attachments then you need to send it. I prefer to use Net::SMTP to send messages, but there are several other perl modules that can send mail (and several ways of just doing it by hand). If you're already using MIME::Lite the easiest method is to use its built-in send function:
$msg->send;
If you're interested in delving deeper, O'Reilly has a decent book entitled Programming Internet Email that covers most of the interesting internet e-mail protocols and formats. It has a good chapter on e-mail related Perl modules.

Replies are listed 'Best First'.
RE: Re: Dealing with atachments.
by Punto (Scribe) on May 18, 2000 at 11:44 UTC
    That a good example.. thanks..
    And, can I use that module if I get the attachment, to convert it to a file?

    Thanks..

      I just posted this snippet which should help you with decoding and extracting attachments from incoming emails.
      MIME::Lite can only encode MIME streams. For decoding a MIME message you'll want to use the MIME::Decoder module.