Perl Email Question

A

amerar

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
portion??

Thanks,

Arthur
 
P

Philip Paeps

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.

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.
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
portion??

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
(e-mail address removed) I follow the newsgroup.

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

Gunnar Hjalmarsson

Philip said:
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.

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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,014
Latest member
BiancaFix3

Latest Threads

Top