I wrote this simple script for attaching a file
i recieve the e-mail but i do'nt get any file attachment - i recieve alot of junk letters instead.
where i go wrong?
thanks,
sigal
$mailprog = "/usr/lib/sendmail";
open (MAIL, "|$mailprog -t -oi -oem"
open (TEXT, "uuencode tst.txt tst.txt |"
while (<TEXT>) {
$User_mail_body .= $_;
}
close TEXT;
print MAIL "To: $cgi_data{'emailAddrs'}\n";
print MAIL "From: $cgi_data{'XX-email'}\n";
print MAIL "Subject: $cgi_data{'XX-subject'}\n\n";
print MAIL "$User_mail_body";
print MAIL "\n";
close (MAIL);
i recieve the e-mail but i do'nt get any file attachment - i recieve alot of junk letters instead.
where i go wrong?
thanks,
sigal
$mailprog = "/usr/lib/sendmail";
open (MAIL, "|$mailprog -t -oi -oem"
open (TEXT, "uuencode tst.txt tst.txt |"
while (<TEXT>) {
$User_mail_body .= $_;
}
close TEXT;
print MAIL "To: $cgi_data{'emailAddrs'}\n";
print MAIL "From: $cgi_data{'XX-email'}\n";
print MAIL "Subject: $cgi_data{'XX-subject'}\n\n";
print MAIL "$User_mail_body";
print MAIL "\n";
close (MAIL);