I have the following script and it sends text mail just fine, but when I send html in the body and receive it with MS Outlook Express, it just gives html code. When I receive it with eudora 4, it gives the actual pictures etc. It is RFC 1521.
unless (open(SENDMAIL, ">$filename")){
print "Error opening email file.";
}
print SENDMAIL "Content-type: text/html\n\n";
print SENDMAIL "From: $from\n";
print SENDMAIL "To: $to\n";
print SENDMAIL "Subject: $subj\n";
print SENDMAIL "Date: $thedate\n";
print SENDMAIL "\n";
print SENDMAIL "$body\n";
close SENDMAIL;
What do I need to add or change to make the Outlook Express convert the html to actual pictures? It must have something to do with content-type:.
You're doing:
print "Content-type: text/html\n\n";
$filename = "C:\\exchsrvr\\imcdata\\Pi
unless (open(SENDMAIL, ">$filename")){
print "Error opening email file.";
}
print SENDMAIL "From: $from\n";
which print's the header to stdout (wherever that might be). Instead, do
$filename = "C:\\exchsrvr\\imcdata\\Pi
unless (open(SENDMAIL, ">$filename")){
print "Error opening email file.";
}
print "Content-type: text/html\n\n";
print SENDMAIL "From: $from\n";
which will tell exchange that this really is html