IIRC (no time to test right now) you simply change the disposition to 
'inline' and attach a file like in the example below. 

On Wed, Mar 09, 2005 at 07:29:14AM -0500, Amy Kline wrote:
> Peter, thanks for the sample code. Is there a way that I can display
> the text file as inline text instead of an attachment.
> 
> something like the following but here I'm making a call to 'cat' which
> I prefer not to if possible.
> 
> $mail->attach ( Disposition => 'inline',
>                 Data => `/usr/bin/cat /tmp/file1.txt`
>          );
> 
> thanks.
> 
> amy
> 
> 
> On Tue, 8 Mar 2005 19:53:12 -0500, Peter Rabbitson <[EMAIL PROTECTED]> 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>
> > >
> > >
> > 
> > --
> > 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