1

How should I format my HTML code so that it displays correctly in Outlook 14? I want to insert a table and would like to see onenin my e-mail. No matter what I tried, I always got the text of the HTML (even if I copied the source of an existing e-mail and sent it to myself!)

I'm doing the sending using Linux's /bin/mail utility.

$ cat file.html | /bin/mail -s "TEST" me@myemail.com

This is done on my company's intranet. Sending the text version works.

gp443
  • 231
  • 2
  • 11

1 Answers1

0

It is not outlook-dependent. By default, mails are interpreted as text. If you want to send a HTML mail, you should inform the mail reader to handle it as html. It can be done with the Content-type: text/html SMTP header, just as in HTTP.

An example mail header which should work:

From: <adam@example.org>
To: <eva@example.org>
Subject: Test
Content-type: text/plain; charset=iso-8859-15
Content-Transfer-Encoding: 8bit

<html><b>test</b></html>

Your mail program is probably a part of your mailing system, but probably it would work if you simple gave this header to the beginning of your mail body. So:

you$ mail -s eva@example.com
Content-type: text/html

<html><b>test</b></html>

If not, most mail softwares contain a tool named sendmail, which is capable to do that.

There are various libraries / modules in every scripting language common in linux, which can create more complex mails as well (attached files, inline images, dual textonly and html content, etc).

peterh
  • 11,875
  • 18
  • 85
  • 108