Good afternoon Gurus!
I am trying to write a script that will use sendmail to upload an email attachment and send it. Sending the email through perl using sendmail is easy enough, but can someone explain how to tweak the code to include an email attachment?
Here is my code so far . . .
Can anyone help with this?
Thanks
I am trying to write a script that will use sendmail to upload an email attachment and send it. Sending the email through perl using sendmail is easy enough, but can someone explain how to tweak the code to include an email attachment?
Here is my code so far . . .
Code:
$sendmail="/usr/lib/sendmail.sendmail -oi -t";
print "starting . . .";
$form_subject="testing";
$form_message="I am now testing the email system for the attachment Hopefully this will actually work.";
$subject = "$form_subject";
$body = "$form_message";
open(MAIL, "| $sendmail") or die "Cant open Sendmail";
print MAIL "To: $to\n";
print MAIL "From: $from\n";
print MAIL "Reply-to: $from\n";
print MAIL "Subject: $subject\n\n";
print MAIL "$body";
close MAIL;
print "Your e-mail has been sent!";
exit;
Can anyone help with this?
Thanks