Solved

send html or text in one email package

Posted on 2004-03-29
3
141 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

How our DevOps Teams Maximize Uptime

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

Question has a verified solution.

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

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…
It is a general practice to get rid of old user profiles on a computer  in a LAN environment. As I have been working with a company in a LAN environment where users move from one place to some other place at times. This will make many user profil…
Learn the basics of modules and packages in Python. Every Python file is a module, ending in the suffix: .py: Modules are a collection of functions and variables.: Packages are a collection of modules.: Module functions and variables are accessed us…
Video by: Mark
This lesson goes over how to construct ordered and unordered lists and how to create hyperlinks.

705 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