Perl Email Question

Discussion in 'Perl Misc' started by amerar@iwc.net, Jun 1, 2005.

  1. Guest

    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
     
    , Jun 1, 2005
    #1
    1. Advertising

  2. Philip Paeps Guest

    <> wrote:
    > 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
    I follow the newsgroup.

    Duncan: I've forgotten every thing I used to know about Z80 assembler.
    Ann: Congratulations you're cured.
     
    Philip Paeps, Jun 2, 2005
    #2
    1. Advertising

  3. Philip Paeps wrote:
    > <> wrote:
    >> 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.


    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
    Email: http://www.gunnar.cc/cgi-bin/contact.pl
     
    Gunnar Hjalmarsson, Jun 2, 2005
    #3
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Peter
    Replies:
    0
    Views:
    3,386
    Peter
    Jul 1, 2003
  2. John Silver
    Replies:
    0
    Views:
    617
    John Silver
    Feb 4, 2005
  3. Tee

    Email ErrorPage to email

    Tee, Jun 23, 2004, in forum: ASP .Net
    Replies:
    0
    Views:
    383
  4. Replies:
    3
    Views:
    538
    AdamM
    Jul 27, 2004
  5. Chuck Amadi
    Replies:
    2
    Views:
    408
    chuck amadi
    Jun 6, 2004
Loading...

Share This Page