the solution....
And the answer is....
Okay, for everyone else who wants to do this using a perl script, I figured out the answer.....
When writing the email header to sendmail, simply include an extra line sending the content type BEFORE sending the double-line carriage that seperates the header from the body. My problem was that I was originally including the "Content-Type: text/html" line AFTER I had already closed the header with a double line break, so sendmail thought it was part of the email body.
So...
open (SM, "|$sendmail $from_email") || print("Sendmail could not be opened") && exit();
print (SM "From: $from_name <$from_email>\n");
print (SM "To: \"$to_name\" <$to_email>\n");
print (SM "Subject: $subject\n");
/* The following two lines were added and allowed the HTML to send inline -- not sure if the "MIME-Version" line is required or not, but it's working now so I won't touch it. */
print (SM "MIME-Version: 1.0\n");
print (SM "Content-Type: text/html\n\n");
/* The following line sets up the HTML for the message so the user doesn't have to include it in the textarea field. */
print (SM "<HTML><BODY>");
print (SM "Hello $to_name!<BR><BR>");
print (SM "$email_content<BR><BR>");
print (SM "To be removed from the mailing list, click the following link.\n");
print (SM "$mailcgisrc?unsubscribe&$to_email\n\n");
/* The following line closes the HTML for finnicky mail programs. */
print (SM "</HTML></BODY>");
close (SM);
And thus, an HTML email is sent to each person on my list.
Paul
|