Perl Email Question

Do you have a question? Post it now! No Registration Necessary.  Now with pictures!

Threaded View

Hi All,

I'm looking at emails that have more than one part.  I currently have a
script that reads a file and sends out the emails.  The email is always
done with HTML, but several of our clients cannot view HTML.

What are the headers that I can code such that if the email client can
understand HTML it displays it, otherwise it just displays the text



Re: Perl Email Question

Quoted text here. Click to load it

This is not really a Perl question.  In general, it's not a good idea to send
HTML email unless the recipients have explicitely asked for it.  It's a lot of
overhead and an unnecessary waste of resources, otherwise.

Quoted text here. Click to load it

You'll want to look at the MIME standard.  You need to use a multipart
Content-Type and you'll have to order the parts such that the HTML version is
the last part.  Further questions should probably be asked in comp.mail.* or
similar places, not in comp.lang.perl.misc.

 - Philip

Philip Paeps                              Please don't email any replies                               I follow the newsgroup.

  Duncan: I've forgotten every thing I used to know about Z80 assembler.
  Ann: Congratulations you're cured.

Re: Perl Email Question

Philip Paeps wrote:
Quoted text here. Click to load it

Well, assuming that the OP wants to do it in Perl, it should be added
that quite a few Perl programmers, i.e. the authors of various modules
for sending email, have already looked at the MIME standard.

So a more straight-forward advice would be: Check out the docs of one of
the CPAN modules with the ability to send multipart messages. My
personal favorite is Mail::Sender, but there are others.

Gunnar Hjalmarsson

Site Timeline