Solved

Send HTML email through Exim using Perl

Posted on 2004-04-10
1
1,099 Views
Last Modified: 2012-08-13
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
Comment
Question by:davef8
1 Comment
 
LVL 84

Accepted Solution

by:
ozo earned 500 total points
ID: 10799648
\n\n indicates the end of the headers
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

On Microsoft Windows, if  when you click or type the name of a .pl file, you get an error "is not recognized as an internal or external command, operable program or batch file", then this means you do not have the .pl file extension associated with …
I have been pestered over the years to produce and distribute regular data extracts, and often the request have explicitly requested the data be emailed as an Excel attachement; specifically Excel, as it appears: CSV files confuse (no Red or Green h…
Explain concepts important to validation of email addresses with regular expressions. Applies to most languages/tools that uses regular expressions. Consider email address RFCs: Look at HTML5 form input element (with type=email) regex pattern: T…
Learn how to create flexible layouts using relative units in CSS.  New relative units added in CSS3 include vw(viewports width), vh(viewports height), vmin(minimum of viewports height and width), and vmax (maximum of viewports height and width).

911 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

17 Experts available now in Live!

Get 1:1 Help Now