I'd like to add an attachment to an email I'm sending from a perl script using sendmail. Here's my code:
#!/usr/bin/perl
use warnings;
use CGI;
use Mail::Sendmail;
$file = "testdoc.txt";
unshift @{$Mail::Sendmail::mailcfg{'smtp'}} , 'AB-MAIL4';
%mail = ( To => 'wsexton@anywhere.net',
From => 'DSU Request Form@anywhere.net',
);
$mail{'mESSaGE : '} = "This is my message.";
sendmail(%mail) or die $Mail::Sendmail::error;
I'd like to attach a file to this email, and I can figure out how it's done. Any help would be appreciated.
#!/usr/bin/perl
use warnings;
use CGI;
use Mail::Sendmail;
$file = "testdoc.txt";
unshift @{$Mail::Sendmail::mailcfg{'smtp'}} , 'AB-MAIL4';
%mail = ( To => 'wsexton@anywhere.net',
From => 'DSU Request Form@anywhere.net',
);
$mail{'mESSaGE : '} = "This is my message.";
sendmail(%mail) or die $Mail::Sendmail::error;
I'd like to attach a file to this email, and I can figure out how it's done. Any help would be appreciated.