Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1207
  • Last Modified:

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: user@whatever.com\n";
print MAIL "From: sender@whatever.com\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.
0
davef8
Asked:
davef8
1 Solution
 
ozoCommented:
\n\n indicates the end of the headers
0

Featured Post

How to Use the Help Bell

Need to boost the visibility of your question for solutions? Use the Experts Exchange Help Bell to confirm priority levels and contact subject-matter experts for question attention.  Check out this how-to article for more information.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now