How can I send email attachment without using an additional library in Perl?

Posted by CheeseConQueso on Stack Overflow See other posts from Stack Overflow or by CheeseConQueso
Published on 2009-05-26T15:15:53Z Indexed on 2010/05/21 12:30 UTC
Read the original article Hit count: 301

Filed under:
|
|

Hey, I was wondering if there is a way to attach files (specifically .csv files) to a mail message in Perl without using MIME::Lite or any other libraries.

Right now, I have a 'mailer function' that works fine, but I'm not sure how to adapt it into attaching files. Here is what I have:

open(MAIL, "|/usr/sbin/sendmail -t");
print MAIL "To: cheese\@yahoo.com\n";
print MAIL "From: queso\@what.com\n";
print MAIL "Subject: Attached is $filename\n\n";
print MAIL "$message";
close(MAIL);

I think this is specific for UNIX.

© Stack Overflow or respective owner

Related posts about perl

Related posts about mail