I'm still a real beginner and think Mail::Sender is about as easy as it
gets... 

Since the subject has been brought up, pls take a look at my simple sub for
emailing files.  I know this code works but can be improved.  I send the
file name(s) to be attached, a file name for the message text, and the rest
of the standard email info to a subroutine.

use Mail::Sender;

email ( \@files, $body_file, $to, $fake_to, $cc, $bcc, $subject );

sub email {
        my ( @msg );
        open ( MSGTXT, $_[1] ) || die "Could not open message file: $!\n";
        while ( <MSGTXT> ) {
                push ( @msg, $_);
        }
        
        $mail = new Mail::Sender
        {smtp => $smtp_server, from => $sender};
        $mail-> MailFile ( 
                {to      => $_[2],
                 fake_to => $_[3],
                 cc      => $_[4],
                 bcc     => $_[5],
                 subject => $_[6],
                 priority=> 1,
                 msg     => "@msg",
                 file    => $_[0]} ) || die "Could not send mail: $!\n";
}

-----Original Message-----
From: Jenda Krynicky [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, November 27, 2001 4:06 AM
To: [EMAIL PROTECTED]
Subject: Re: Send e-mail attachment


From:                   "paul beckett (JIC)" <[EMAIL PROTECTED]>
> Does anybody know how I can send a smallish binary file as an e-mail
> attachment, from perl (running on UNIX (OSFv.4.0))

Either MIME-lite or Mail::Sender. Both available from CPAN

Jenda

=========== [EMAIL PROTECTED] == http://Jenda.Krynicky.cz ==========
There is a reason for living. There must be. I've seen it somewhere.
It's just that in the mess on my table ... and in my brain.
I can't find it.
                                        --- me

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to