Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > HTML > HTML email

Reply
Thread Tools

HTML email

 
 
Jeff Thies
Guest
Posts: n/a
 
      08-15-2004
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
 
Reply With Quote
 
 
 
 
Toby Inkster
Guest
Posts: n/a
 
      08-15-2004
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

 
Reply With Quote
 
 
 
 
David Dorward
Guest
Posts: n/a
 
      08-15-2004
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
 
Reply With Quote
 
Jeff Thies
Guest
Posts: n/a
 
      08-15-2004
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

 
Reply With Quote
 
Jeff Thies
Guest
Posts: n/a
 
      08-15-2004
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
>

 
Reply With Quote
 
Toby Inkster
Guest
Posts: n/a
 
      08-15-2004
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

 
Reply With Quote
 
Toby Inkster
Guest
Posts: n/a
 
      08-15-2004
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

 
Reply With Quote
 
Toby Inkster
Guest
Posts: n/a
 
      08-15-2004
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

 
Reply With Quote
 
David Dorward
Guest
Posts: n/a
 
      08-15-2004
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
 
Reply With Quote
 
Karl Groves
Guest
Posts: n/a
 
      08-15-2004

"David Dorward" <(E-Mail Removed)> wrote in message
news:cfnasr$4r2$1$(E-Mail Removed)...
> 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


 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
firefox html, my downloaded html and firebug html different? Adam Akhtar Ruby 9 08-16-2008 07:55 PM
HTML Anchor Tags in HTML Email Clients mranteatertoyou@gmail.com HTML 1 03-30-2006 06:03 AM
Email server timing out in email script John Silver Perl 0 02-04-2005 07:47 AM
Re: Which email clients support HTML email Howard NZ Computing 3 11-21-2003 09:57 AM
HowTo:? open email client to send email Peter ASP .Net 0 07-01-2003 04:58 PM



Advertisments