LPM: Email attachments

Steve Lane sml at zfx.com
Wed Mar 22 14:32:04 CST 2000


Rich Bowen wrote:
> 
> >   # mail the message
> >   open MAIL, "|/usr/sbin/sendmail -oi -t" or die "can't open sendmail:
> > $!";
> >   $mail->print(\*MAIL);
> >   close MAIL or die "can't close sendmail: $!";
> 
> Thanks. Sample code is nice.
> I'm wondering if I can use something other than sendmail to actually
> send the mail. I use Mail::Sendmail because 1) it does not require
> spawning another process and 2) it works on NT. I'll have to play with
> this to see if I can send the mssage to Mail::Sendmail instead of
> sendmail. Or, perhaps I'll just have to write a module that inherits
> from those two modules, and just does what I need.

i've never used Mail::Sendmail, so i don't know if it expects
a raw blob of data, but you may be able to use the $mail->as_string
(or $mail->header_as_string or $mail->body_as_string) methods
of MIME::Entity to get the message as a string.  i would
look at the MIME::Entity source to see what you can do.
--
Steve Lane <sml at zfx.com>



More information about the Lexington-pm mailing list