HTML email

Discussion in 'HTML' started by Jeff Thies, Aug 15, 2004.

  1. Jeff Thies

    Jeff Thies Guest

    It seems like I have to write an HTML formatted email (and I'm a
    plain text guy!). So apart from the politics of this, what needs to go
    in an HTML email?

    It appears to me that if the html, body and head tags are optional for a
    web page they probably aren't needed in HTML email either. Page titles
    would certainly be useless!

    So, I'm thinking.

    A content-type, doctype and a stylesheet and then html, nothing else...
    Or is there a reason to have all that extra baggage?

    Jeff
     
    Jeff Thies, Aug 15, 2004
    #1
    1. Advertising

  2. Jeff Thies

    Toby Inkster Guest

    Jeff Thies wrote:

    > It appears to me that if the html, body and head tags are optional for a
    > web page they probably aren't needed in HTML email either. Page titles
    > would certainly be useless!


    Almost useless, but still required. Their use would be to e-mail clients
    that can't process HTML directly but launch the page in a browser.

    > A content-type, doctype and a stylesheet and then html, nothing else...


    Do you need to embed images? If so, it gets a *lot* more complicated.

    --
    Toby A Inkster BSc (Hons) ARCS
    Contact Me ~ http://tobyinkster.co.uk/contact
     
    Toby Inkster, Aug 15, 2004
    #2
    1. Advertising

  3. Jeff Thies wrote:

    > A content-type,


    Several content types - you need, at least, a plain text alternative but
    possibly also images.

    > doctype


    In HTML the <html>, <head>, and <body> tags are optional (the elements
    aren't, but they are implied)

    > and a stylesheet


    Stylesheets and many email clients do not mix nicely. This is one instance
    where it is better to resport to inline style.

    > and then html, nothing else...
    > Or is there a reason to have all that extra baggage?


    Spam filters really hate HTML email without a plain text alternative. So do
    people who use email clients which don't support HTML formatted email.

    --
    David Dorward <http://blog.dorward.me.uk/> <http://dorward.me.uk/>
    Home is where the ~/.bashrc is
     
    David Dorward, Aug 15, 2004
    #3
  4. Jeff Thies

    Jeff Thies Guest

    David Dorward wrote:
    > Jeff Thies wrote:
    >
    >
    >>A content-type,

    >
    >
    > Several content types - you need, at least, a plain text alternative but
    > possibly also images.


    Lets say I'm going to do a multipart, not that I really want to. It
    looks this way to me:

    Content-Type: multipart/alternative;
    boundary=--some_long_random_string

    --some_long_random_string

    Content-Type: text/plain; charset=ISO-8859-1

    .... plaint text message ...

    --some_long_random_string

    Content-Type: text/html; charset=ISO-8859-1

    --some_long_random_string

    Is there something else needed and are there any rules for that message
    seperator string?


    >
    >
    >>doctype

    >
    >
    > In HTML the <html>, <head>, and <body> tags are optional (the elements
    > aren't, but they are implied)
    >
    >
    >>and a stylesheet

    >
    >
    > Stylesheets and many email clients do not mix nicely. This is one instance
    > where it is better to resport to inline style.


    Lovely! I've just looked through some html message sources and I see
    that they are largely tag soup!
    >
    >
    >>and then html, nothing else...
    >>Or is there a reason to have all that extra baggage?

    >
    >
    > Spam filters really hate HTML email without a plain text alternative. So do
    > people who use email clients which don't support HTML formatted email.
    >

    OK, so how do I get out of this cleanly? If I do a plain text
    alternative do I still have to abandon a stylesheet?

    Jeff
     
    Jeff Thies, Aug 15, 2004
    #4
  5. Jeff Thies

    Jeff Thies Guest

    Toby Inkster wrote:

    > Jeff Thies wrote:
    >
    >
    >>It appears to me that if the html, body and head tags are optional for a
    >>web page they probably aren't needed in HTML email either. Page titles
    >>would certainly be useless!

    >
    >
    > Almost useless, but still required. Their use would be to e-mail clients
    > that can't process HTML directly but launch the page in a browser.


    Which mail clients don't support HTML email directly? How large of the
    market is that?

    >
    >
    >>A content-type, doctype and a stylesheet and then html, nothing else...

    >
    >
    > Do you need to embed images? If so, it gets a *lot* more complicated.


    Nope, just the usual shopping cart reprise. Client has paper design
    skills and specifically requested HTML emails. I'm not thrilled about
    putting together a multipart mixed mime type message.

    See reply to David about questions about putting together a text
    alternative email.

    Jeff
    >
     
    Jeff Thies, Aug 15, 2004
    #5
  6. Jeff Thies

    Toby Inkster Guest

    Jeff Thies wrote:

    > Lets say I'm going to do a multipart, not that I really want to. It
    > looks this way to me:
    >
    > Content-Type: multipart/alternative;
    > boundary=--some_long_random_string
    >
    > --some_long_random_string
    >
    > Content-Type: text/plain; charset=ISO-8859-1
    >
    > ... plaint text message ...
    >
    > --some_long_random_string
    >
    > Content-Type: text/html; charset=ISO-8859-1
    >
    > --some_long_random_string
    >
    > Is there something else needed and are there any rules for that message
    > seperator string?


    IIRC, the last boundary at the very end ought to have another '--'
    appended to it.

    There are rules for the boundary. Stil to alphanumerics and you'll be OK.
    One rule of course is that the boundary should not appear in the real data
    anywhere!

    See the MIME RFCs for more details. IIRC OTTOMH it's RFC 2045 et al.

    --
    Toby A Inkster BSc (Hons) ARCS
    Contact Me ~ http://tobyinkster.co.uk/contact
    Now Playing ~ ./dido/life_for_rent/10_-_this_land_is_mine.ogg
     
    Toby Inkster, Aug 15, 2004
    #6
  7. Jeff Thies

    Toby Inkster Guest

    Jeff Thies wrote:

    > Which mail clients don't support HTML email directly? How large of the
    > market is that?


    Becky2 doesn't. (Although IIRC it has an option to embed an Internet
    Explorer control -- this is switched off by default for security reasons)
    Mutt doesn't (most Mutt users pipe HTML messages through "lynx -dump"),
    Sylpheed didn't last time I used it (though there was a patch that allowed
    it to embed a Dillo control to render HTML). Don't think PINE does. Et
    cetera, et cetera.

    --
    Toby A Inkster BSc (Hons) ARCS
    Contact Me ~ http://tobyinkster.co.uk/contact
    Now Playing ~ ./semisonic/all_about_chemistry/08_i_wish.ogg
     
    Toby Inkster, Aug 15, 2004
    #7
  8. Jeff Thies

    Toby Inkster Guest

    Toby Inkster wrote:

    > Stil


    WTF am I on about? "Stil" is not even close to "Stick", which is what I
    meant.

    --
    Toby A Inkster BSc (Hons) ARCS
    Contact Me ~ http://tobyinkster.co.uk/contact
     
    Toby Inkster, Aug 15, 2004
    #8
  9. Jeff Thies wrote:

    > --some_long_random_string
    >
    > Is there something else needed and are there any rules for that message
    > seperator string?


    I suggest finding a prewritten MIME library for whatever you are producing
    the email with. That saves having to worry about reinventing the wheel.

    >> Stylesheets and many email clients do not mix nicely. This is one
    >> instance where it is better to resport to inline style.

    >
    > Lovely! I've just looked through some html message sources and I see
    > that they are largely tag soup!


    Most webpages are largely tag soup :)

    It is prossible to produce reasonable HTML for emails... the style
    attributes just make it a tad messy.

    >> Spam filters really hate HTML email without a plain text alternative. So
    >> do people who use email clients which don't support HTML formatted email.
    >>

    > OK, so how do I get out of this cleanly? If I do a plain text
    > alternative do I still have to abandon a stylesheet?


    The plain text alternative is for email clients which can't cope with HTML
    formatted mail at all.

    Many email clients which do support HTML formatted mail (such as, IIRC, the
    Hotmail and Yahoo! Mail web interfaces) strip the <head> section off
    entirely, thus losing any <style> or <link> elements. So if you want it to
    be pretty you either have to use inline style, or deprecated markup (and
    abuse tables etc).

    --
    David Dorward <http://blog.dorward.me.uk/> <http://dorward.me.uk/>
    Home is where the ~/.bashrc is
     
    David Dorward, Aug 15, 2004
    #9
  10. Jeff Thies

    Karl Groves Guest

    "David Dorward" <> wrote in message
    news:cfnasr$4r2$1$...
    > Jeff Thies wrote:


    > > and a stylesheet

    >
    > Stylesheets and many email clients do not mix nicely. This is one instance
    > where it is better to resport to inline style.


    IIRC, the only CSS that gets you in trouble with e-mail clients is rather
    advanced layout stuff.
    If you need to do webpage-like layout in the HTML email, this is one place
    where tables are definitely preferred.

    -Karl
     
    Karl Groves, Aug 15, 2004
    #10
  11. Jeff Thies

    Karl Groves Guest

    "Jeff Thies" <> wrote in message
    news:fuHTc.21888$...
    > Toby Inkster wrote:


    > > Almost useless, but still required. Their use would be to e-mail clients
    > > that can't process HTML directly but launch the page in a browser.

    >
    > Which mail clients don't support HTML email directly? How large of the
    > market is that?
    >


    I think the incidence of people who have this feature turned off is a factor
    that can be at least as important as those whose client does not support it.
    It all depends on your target audience. If your target audience people who
    work for the US Government or defense industry (like mine) then there will
    be a lot of people whose IT department mandates that they do not accept HTML
    email. If your target audience is people at home, then it will only be a
    very small number of people who can't support it.

    Regardless, always offer a text alternative when users subscribe to the
    newsletter (this is an opt-in thing, isn't it?)

    -Karl
     
    Karl Groves, Aug 15, 2004
    #11
  12. Jeff Thies

    WebcastMaker Guest

    In article <fuHTc.21888$>,
    says...
    > Which mail clients don't support HTML email directly? How large of the
    > market is that?


    none of them do if the user doesn't want it to. How large a market?
    Good guess would be that it is equally as large as the percentage that
    does not have javascript turned on. That ranges anywhere from 10%-20%
    depending on who you ask.

    --
    WebcastMaker
    Webcastng for free
    http://www.webentations.com
     
    WebcastMaker, Aug 15, 2004
    #12
  13. Jeff Thies

    WebcastMaker Guest

    In article <>,
    says...
    > > Stil

    > WTF am I on about? "Stil" is not even close to "Stick", which is what I
    > meant.


    Hey! Don't bogart! (Man how long has it been since I said that...)
    --
    WebcastMaker
    Webcastng for free
    http://www.webentations.com
     
    WebcastMaker, Aug 15, 2004
    #13
  14. Jeff Thies

    WebcastMaker Guest

    In article <cfnh69$8dm$>,
    says...
    > If you need to do webpage-like layout in the HTML email, this is one place
    > where tables are definitely preferred.


    Chest hurting.... difficulty in breathing... (clutching chest...)
    --
    WebcastMaker
    Webcasting for free
    http://www.webentations.com
     
    WebcastMaker, Aug 15, 2004
    #14
  15. Jeff Thies

    Jeff Thies Guest

    <snip>

    > Many email clients which do support HTML formatted mail (such as, IIRC, the
    > Hotmail and Yahoo! Mail web interfaces) strip the <head> section off
    > entirely, thus losing any <style> or <link> elements. So if you want it to
    > be pretty you either have to use inline style, or deprecated markup (and
    > abuse tables etc).


    Hmmmm.

    I'm taking html that has already been formatted elsewhere and reprising
    it. Most concerned with: border-collapse: collapse and maybe a font
    issue or two. BTW, this is naturally tabular data (order form).

    Seems to me that I can just add a stylesheet *after* the body tag. All
    those rules would still apply except for those pertaining to the body,
    of course.

    Jeff
     
    Jeff Thies, Aug 15, 2004
    #15
  16. Jeff Thies

    Spartanicus Guest

    Toby Inkster <> wrote:

    >> It appears to me that if the html, body and head tags are optional for a
    >> web page they probably aren't needed in HTML email either. Page titles
    >> would certainly be useless!

    >
    >Almost useless, but still required. Their use would be to e-mail clients
    >that can't process HTML directly but launch the page in a browser.


    And web browser email extensions (Opera's M2).

    --
    Spartanicus
     
    Spartanicus, Aug 15, 2004
    #16
  17. *Karl Groves* wrote:
    > "David Dorward" <> wrote in message
    > news:cfnasr$4r2$1$...
    >> Stylesheets and many email clients do not mix nicely. This is one
    >> instance where it is better to resport to inline style.

    >
    > IIRC, the only CSS that gets you in trouble with e-mail clients is
    > rather advanced layout stuff.
    > If you need to do webpage-like layout in the HTML email, this is one
    > place where tables are definitely preferred.


    Not really been paying attention to this thread, so this may have been
    mentioned already: http://www.alistapart.com/articles/cssemail/
    --
    Andrew Urquhart
    - FAQ: http://www.html-faq.com
    - Contact me: http://andrewu.co.uk/contact/
    - This post is probably time-stamped +1 hour - blame my ISP (NTL)
     
    Andrew Urquhart, Aug 15, 2004
    #17
  18. Jeff Thies wrote:

    > Seems to me that I can just add a stylesheet *after* the body tag.


    Not in HTML.

    --
    David Dorward <http://blog.dorward.me.uk/> <http://dorward.me.uk/>
    Home is where the ~/.bashrc is
     
    David Dorward, Aug 15, 2004
    #18
  19. Jeff Thies

    Dave Patton Guest

    Jeff Thies <> wrote in
    news:AlATc.25612$:

    > It seems like I have to write an HTML formatted email (and I'm a
    > plain text guy!). So apart from the politics of this, what needs to go
    > in an HTML email?


    Make sure to offer the choice of email formatting to the
    users when they provide their email address, as well
    as a way to login later and change the setting. I'd
    suggest the default be plain text, but the client may
    want the default as HTML. You have to be able to format
    the content as both plain text and HTML to send emails
    that contain both, so you may as well have the option
    to send emails that are only plain text.

    --
    Dave Patton
    Canadian Coordinator, Degree Confluence Project
    http://www.confluence.org/
    My website: http://members.shaw.ca/davepatton/
     
    Dave Patton, Aug 15, 2004
    #19
  20. Jeff Thies

    Jeff Thies Guest

    David Dorward wrote:
    > Jeff Thies wrote:
    >
    >
    >>Seems to me that I can just add a stylesheet *after* the body tag.

    >
    >
    > Not in HTML.
    >

    Well, you can't use <nobr> either, but it works widely if not universally.

    Considering that there are mail clients that reject mail with linked
    stylesheets (AOL) and others that strip out the head (most web based)...

    From Andrew: <URL: http://www.alistapart.com/articles/cssemail/ >

    Is there a browser out there that doesn't use styles (except for body
    styles) that are in a stylesheet after the body tag?

    I know that Opera7, all NS4+,IE5+, Thunderbird have no problem.

    It seems to me that the worst that would happen is that would be no
    styles and even that is unlikely.

    No?

    That has to better than tag soup or inling every style.

    Jeff
     
    Jeff Thies, Aug 15, 2004
    #20
    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,426
    Peter
    Jul 1, 2003
  2. John Silver
    Replies:
    0
    Views:
    634
    John Silver
    Feb 4, 2005
  3. Tee

    Email ErrorPage to email

    Tee, Jun 23, 2004, in forum: ASP .Net
    Replies:
    0
    Views:
    397
  4. Replies:
    1
    Views:
    6,372
    Toby Inkster
    Mar 30, 2006
  5. Replies:
    2
    Views:
    111
    Richard Balbat
    Nov 12, 2013
Loading...

Share This Page