Velocity Reviews

Velocity Reviews (http://www.velocityreviews.com/forums/index.php)
-   HTML (http://www.velocityreviews.com/forums/f31-html.html)
-   -   HTML email (http://www.velocityreviews.com/forums/t159074-html-email.html)

Jeff Thies 08-15-2004 03:00 AM

HTML email
 
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

Toby Inkster 08-15-2004 08:42 AM

Re: HTML email
 
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


David Dorward 08-15-2004 09:34 AM

Re: HTML email
 
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

Jeff Thies 08-15-2004 11:06 AM

Re: HTML email
 
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 08-15-2004 11:07 AM

Re: HTML email
 
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
>


Toby Inkster 08-15-2004 11:16 AM

Re: HTML email
 
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 08-15-2004 11:20 AM

Re: HTML email
 
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 08-15-2004 11:22 AM

Re: HTML email
 
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


David Dorward 08-15-2004 11:24 AM

Re: HTML email
 
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

Karl Groves 08-15-2004 11:24 AM

Re: HTML email
 

"David Dorward" <dorward@yahoo.com> wrote in message
news:cfnasr$4r2$1$8302bc10@news.demon.co.uk...
> 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




All times are GMT. The time now is 10:01 AM.

Powered by vBulletin®. Copyright ©2000 - 2014, vBulletin Solutions, Inc.
SEO by vBSEO ©2010, Crawlability, Inc.