• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 147
  • 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
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Introducing Cloud Class® training courses

Tech changes fast. You can learn faster. That’s why we’re bringing professional training courses to Experts Exchange. With a subscription, you can access all the Cloud Class® courses to expand your education, prep for certifications, and get top-notch instructions.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now