Or use the "new" collection of Email::* modules for handling Mime stuff.

Email::Simple would do the job.


On Tue, 2005-03-08 at 19:53 -0500, Peter Rabbitson wrote:
> As stated earlier on the list I believe, I would not use an external program 
> call. Instead use the MIME::Lite - clean and simple:
> 
> my $mail = MIME::Lite->new (  From => $from_email,
>                               To => $to_email,
>                               Subject => 'Test',
>                               Type =>'multipart/mixed'
>                       );
> 
> $mail->attach (       Disposition => 'attachment',
>               Path => '/tmp/file1.txt'
>       );
> 
> $mail->attach ( Disposition => 'attachment',
>                 Path => '/tmp/file2.txt'
>         );
> 
> $mail->attach ( Disposition => 'inline',
>               Data => $inline_text
>       );
> 
> $mail->send ( 'smtp', 'smtp.myisp.com', Timeout=>60 );
> 
> 
> On Tue, Mar 08, 2005 at 06:05:33PM -0500, Amy Kline wrote:
> > Hi,
> > How do I modify the following code to email a file (textfile.txt) to
> > [EMAIL PROTECTED]
> > 
> > open (MAIL, "|/usr/bin/mail [EMAIL PROTECTED]");
> > print MAIL "Subject: test";
> > print MAIL "This is a test";
> > close MAIL;
> > 
> > The above code works fine but instead of sending the text - "This is a
> > test", I would like to send a file, textfile.txt.
> > 
> > thanks.
> > 
> > amy
> > 
> > -- 
> > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > For additional commands, e-mail: [EMAIL PROTECTED]
> > <http://learn.perl.org/> <http://learn.perl.org/first-response>
> > 
> > 
> 
-- 
Marco Antonio Manzo Bañuelos
[EMAIL PROTECTED]
http://www.unixmonkeys.com/amnesiac/


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>


Reply via email to