I was wondering if I could get some help with sending attachments via email using sendmail. I can get my script to send regular text emails but I'm not sure how to append attachments. Here is my code so far:
my $mailprog = '/usr/lib/sendmail'; foreach my $dirContent ( @dirContents ) { open (MAIL, "|$mailprog $recipient") || die "Can't open $mailprog!\n"; print MAIL "Reply-to:jc\@home.com\n"; print MAIL "Subject: $dirContent\n"; print MAIL"The file $dirContent is attached.\n"; } close (MAIL);
I think I can use send to send out attachments, but I'm not quite sure how this works.
Any ideas? Thanks!
jc
In reply to Sending email attachments by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |