Solved

send html or text in one email package

Posted on 2004-03-29
3
138 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
ID: 10703198
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
ID: 10709239
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
ID: 10721557
you are right, I am generating the html message in the script.  MIME::Lite is right.  

Nice example page, thanks!
0

Featured Post

3 Use Cases for Connected Systems

Our Dev teams are like yours. They’re continually cranking out code for new features/bugs fixes, testing, deploying, testing some more, responding to production monitoring events and more. It’s complex. So, we thought you’d like to see what’s working for us.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Sed question 2 86
Need to learn promise API 2 51
Register AutoHotkey 12 74
Creating 2 files from output with Powershell 5 46
This tutorial will discuss fancy secure registration forms, with AJAX technology support. In this article I assume you already know HTML and some JS. I will write the code using WhizBase Server Pages, so you need to know some basics in WBSP (you mig…
Making a simple AJAX shopping cart Couple years ago I made my first shopping cart, I used iframe and JavaScript, it was very good at that time, there were no sessions or AJAX, I used cookies on clients machine. Today we have more advanced techno…
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 …
Video by: Mark
This lesson goes over how to construct ordered and unordered lists and how to create hyperlinks.

809 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