XHTML Mime-based Emails

JavaScript and client side scripting.

Moderator: General Moderators

Post Reply
Gen-ik
DevNet Resident
Posts: 1059
Joined: Mon Aug 12, 2002 7:08 pm
Location: London. UK.

XHTML Mime-based Emails

Post by Gen-ik »

Probably shouldn't be in the PHP area but hey-ho.

I've just finished coding my own email class{} and was wondering if it's wise to send emails in the XHTML format.

Outlook Express seems to handle it ok, has anyone tried it with any other email progs?
User avatar
volka
DevNet Evangelist
Posts: 8391
Joined: Tue May 07, 2002 9:48 am
Location: Berlin, ger

Post by volka »

which content-type do you set?
good ol' text/html or appliation/xhtml+xml ?
User avatar
Fredix
Forum Contributor
Posts: 101
Joined: Fri Jul 18, 2003 2:16 pm
Location: Wehr (Eifel) Germany
Contact:

Re: XHTML Mime-based Emails

Post by Fredix »

Gen-ik wrote: and was wondering if it's wise to send emails in the XHTML format.
Only if you are absolutely sure that there is absolutely no way doing without HTML stuff in your mails. It think that there most users would be grateful if they receive emails that are not HTML formatted (or at least I would be). If you use HTML you should offer both possibilities (text and HTML emails)
Gen-ik
DevNet Resident
Posts: 1059
Joined: Mon Aug 12, 2002 7:08 pm
Location: London. UK.

Post by Gen-ik »

volka wrote:which content-type do you set?
good ol' text/html or appliation/xhtml+xml ?
Not too sure what you mean.

The basic XHTML template I use for the emails is this..

Code: Select all

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html>

<head>

<title> &#1111;:subject:]  </title>

<style type="text/css"> &#1111;:style:] </style>

</head>

<body>

&#1111;:message:]

</body>

</html>
The actual mime-content-type depends on wether or not the email contains any images and/or attachments. It could be multipart/alternative, multipart/mixed, or multipart/related.

If the email is mime-based then there are two parts to it.... text/plain and text/html.
Gen-ik
DevNet Resident
Posts: 1059
Joined: Mon Aug 12, 2002 7:08 pm
Location: London. UK.

Re: XHTML Mime-based Emails

Post by Gen-ik »

Fredix wrote:
Gen-ik wrote: and was wondering if it's wise to send emails in the XHTML format.
Only if you are absolutely sure that there is absolutely no way doing without HTML stuff in your mails. It think that there most users would be grateful if they receive emails that are not HTML formatted (or at least I would be). If you use HTML you should offer both possibilities (text and HTML emails)
The type of email sent depends on which Email Format the user has selected.. either HTML or Plain-text.
Post Reply