Re[2]: [Scottish] html email
Calum Matheson
scottish at mailman.lug.org.uk
Tue May 20 20:50:01 2003
Hi Neil,
On a nice sunny Tuesday, the date being 20/05/2003, at precisely 5:34:05 PM, an infinite number of monkeys controlled by Neil MacColl did speaketh the following to Calum Matheson:
NM> this is my first bash at this html email thing. We just wrote html in the
NM> body of the email and sent it. I know that the headers would have come up as
NM> text and not text/html in the content-type. It was just strange that the
NM> linux boxes worked that way and the windows boxes don't. I kneed to know how
NM> to get a html email working properly, preferably without any additional
NM> software, or some way to change the e-mail headers.
>From the X-Mailer header it looks like your using outlook express.
The only way you can do it normally is using OE's html editor. Typing
html into a plain text email will not work (the only reason it appears
to is because the linux clients you are using must be rendering it
wrongly).
You could always start typing an html mail in OE, then save it as a
.msg file (or whatever it saves as). Then edit the html within that
file using a text editor, and then reopen it with OE and send it.
It's not a very elegant solution though.
Another way would be to telnet into an SMTP server and write the email
raw.
This link explains how to send email by telnetting to your ISPs mstp
server
http://www.yuki-onna.co.uk/email/smtp.html
You'll need to set up boundaries and all sorts though.
You could write something in PHP that would do this for you.
You want to have
----------------------------------------------------------------
MIME-Version: 1.0
Content-Type: multipart/alternative; boundary="12345"
----------------------------------------------------------------
in the headers somewhere and
----------------------------------------------------------------
This is a multi-part message in MIME format.
--12345
Content-Type: text/plain; charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
hello
--12345
Content-Type: text/html; charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
<HTML>
<p>hello</p>
</HTML>
--12345--
----------------------------------------------------------------
as the message body.
Unique boundary strings can be calculated by MD5ing the time and some
random value.
Make sure you provide a plain text alternative for the emails you are
sending. It's only nice.
--
Calum mailto:cbm@gmx.co.uk