Solved

send html or text in one email package

Posted on 2004-03-29
3
135 Views
Last Modified: 2013-12-25
I want to use perl cgi to send an email which will display html if the mail client on the receiving end supports it, or plain text if it does not.  Anybody know how to do this?

thanks
0
Comment
Question by:sidikiisajawa
3 Comments
 
LVL 17

Expert Comment

by:dorward
Comment Utility
You need to send a multipart MIME email with a text/plain alternative.

http://search.cpan.org/~alian/MIME-Lite-HTML-1.19/HTML.pm
0
 
LVL 48

Accepted Solution

by:
Tintin earned 250 total points
Comment Utility
MIME::Lite::HTML is useful if you want to mail of an existing HTML page, however, I suspect you just want to generate your own message dynamically (could be wrong here), in which case the MIME::Lite module.  See http://search.cpan.org/~yves/MIME-Lite-3.01/lib/MIME/Lite.pm

Specifically, there is an example that will do exactly what you require.

See http://search.cpan.org/~yves/MIME-Lite-3.01/examples/mime_postcard
0
 

Author Comment

by:sidikiisajawa
Comment Utility
you are right, I am generating the html message in the script.  MIME::Lite is right.  

Nice example page, thanks!
0

Featured Post

Threat Intelligence Starter Resources

Integrating threat intelligence can be challenging, and not all companies are ready. These resources can help you build awareness and prepare for defense.

Join & Write a Comment

Introduction:   Welcome to my first article ever. To begin with, the reason I write this article.  I participated in a question on Experts Exchange about the start command in Windows and there were some discussion about the usage. The discussio…
This article will show, step by step, how to integrate R code into a R Sweave document
Learn the basics of if, else, and elif statements in Python 2.7. Use "if" statements to test a specified condition.: The structure of an if statement is as follows: (CODE) Use "else" statements to allow the execution of an alternative, if the …
The viewer will learn how to dynamically set the form action using jQuery.

762 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

14 Experts available now in Live!

Get 1:1 Help Now