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>
> 
> 

-- 
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