• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 144
  • Last Modified:

send html or text in one email package

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
sidikiisajawa
Asked:
sidikiisajawa
1 Solution
 
dorwardCommented:
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
 
TintinCommented:
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
 
sidikiisajawaAuthor Commented:
you are right, I am generating the html message in the script.  MIME::Lite is right.  

Nice example page, thanks!
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