how to send html formatted mail from SMTP to Outlook?

  • Thread starter Thread starter nickelstat
  • Start date Start date
N

nickelstat

I am trying to send this simple test html, trying to make it appear in
outlook as html
from Unix via smtp (actually using Perl's Net::SMTP package)

Content-Type: text/html

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html><head>
<META http-equiv=Content-Type content="text/html; charset=us-ascii">
<style type="text/css">
#black {
background-color: black;
color: yellow;
font-style:bold;
}

</style>
</head>
<BODY lang=EN-US vLink=purple link=blue>
<table border><tr>
<th>col1
<th>col2
</tr><tr>
<td>data1
<td>data2
</tr><tr>
<td>data11
<td>data22
</tr></table>
</body> </html>

But it keeps coming up as text (the html program itself is displayed)

One person suggested I added "Content-Type: text/html" as in CGI, but
that did not work neither since I added it in the BODY.

What does outlook expect in order to recognize the message as HTML, and
how do I send it via SMTP? (which part of the header? is there an RFC I
can read? I've scanned some RFC's but could not find the right one)

Thanks in advance
 
I found RFC 2045 that talks about Content-Type in header fields, but
gave no example on WHICH HEADER field, and where it fits in the smtp
sequence.

Any example would be very much appreciated.
 
Found RFC 2076 which defines a whole bunch of headers, and what they
are.

That meant I put the Content-Type header in the wrong place (inside the
body)

got it to work now.
 
Back
Top