Just in case the other answer were a bit short, here is what you can do:
Generating an email :
$subject, $from and $msg should be definied somewhere.
To attach a document, you should uuencode it with the uuencode utility, it
will give you a huge string that you include into your message $msg.
It will be seen as a Mime document and decoded accordingly by the mail reader
it has the ability to do it (displaying it as an attached document)
use HTTP::Request;
use HTTP::Response;
use LWP::UserAgent;
my $acces = new LWP::UserAgent('mail.pl');
my $requete = new HTTP::Request(POST => "mailto:$to");
$requete->header(Subject => $subject,
From => $from);
$requete->content($msg);
my $reponse = $acces->request($requete) ;
if ($reponse->is_success())
{
# do whatever you like
}
else
{
# same
}
-----Message d'origine-----
De : Mueller, Juergen (pro.vider GmbH iG) <[EMAIL PROTECTED]>
� : '[EMAIL PROTECTED]' <[EMAIL PROTECTED]>
Date : vendredi 25 f�vrier 2000 16:30
Objet : attaching a document
>Hello,
>
>I'm not quite sure if this is the right list for my question, anyway... ;-)
>
>If one wants to generate an email, the perl-code surely looks something like
>that:
>
> open(MAIL,"|$mailprog -t");
>
> print MAIL "To: info\@host.de\n";
> print MAIL "From: $input{'absender'}\n";
> print MAIL "Subject: Hallo Juergen\n\n";
> print MAIL "\n";
> print MAIL "Text der Email\n";
> print MAIL "blabla ...\n\n";
>
> close (MAIL);
>
>
>Questions:
>What is the code to attache a document to such a script-generated email?
>
>Thanks a lot.
>
>Juergen