Question : Send HTML email through Exim using Perl

I have a linux server RHEL 3.0 with Exim 4 as the mail server. I have a Perl script that is trying to send an HTML email through Exim. However when the message is delivered it always shows up as plain text with all the HTML not being rendered by any of the clients.  I am sure this isn't client side as I have tested it with numerous clients who are all able to receive HTML email from other sources.

Here is a snippet of the perl script:

open(MAIL, "|/usr/sbin/exim -t");
print MAIL "To: [email protected]\n";
print MAIL "From: [email protected]\n";
print MAIL "Subject: Place Subject Here\n\n";
print MAIL "MIME-Version: 1.0\n";
print MAIL"Content-Type: text/html; charset=us-ascii\n";
print MAIL "BASIC HTML TAGS GO HERE";
close(MAIL);

When I send this users seen all my HTML mark up starting with "MIME-Version: 1.0 and Content-Type: text/html". Exim doesn't register those as headers and simply treats them as the body of a text message.

Answer : Send HTML email through Exim using Perl

\n\n indicates the end of the headers
Random Solutions  
 
programming4us programming4us