Solved

Send HTML email through Exim using Perl

Posted on 2004-04-10
1
1,092 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

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

Suggested Solutions

A year or so back I was asked to have a play with MongoDB; within half an hour I had downloaded (http://www.mongodb.org/downloads),  installed and started the daemon, and had a console window open. After an hour or two of playing at the command …
In the distant past (last year) I hacked together a little toy that would allow a couple of Manager types to query, preview, and extract data from a number of MongoDB instances, to their tool of choice: Excel (http://dilbert.com/strips/comic/2007-08…
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…
Excel styles will make formatting consistent and let you apply and change formatting faster. In this tutorial, you'll learn how to use Excel's built-in styles, how to modify styles, and how to create your own. You'll also learn how to use your custo…

708 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

15 Experts available now in Live!

Get 1:1 Help Now