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?

Who is Participating?
TintinConnect With a Mentor Commented:
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

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

You need to send a multipart MIME email with a text/plain alternative.
sidikiisajawaAuthor Commented:
you are right, I am generating the html message in the script.  MIME::Lite is right.  

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

All Courses

From novice to tech pro — start learning today.