Re: mail and html

"Brian K. White" <[email protected]>
Newsgroups gmane.linux.redhat.release.enigma
Organization Aljex Software
Message-ID <005801c2df6c$a3d59220$0e00000a@briandesk>
Terry Orgill wrote:
> I am using html to format documents, like invoices.  I can add
> graphics, change fonts and colors and all sorts of nifty stuff.  I
> want to use mail or pine or something to send these html files so
> they will pull up in the mail client formatted.  If you simply do a
> 'mail [email protected] < invoice.html' joe will see a bunch of
> <html><body></body></html>.  What is needed is a simple
> 'Content-type: TEXT/HTML' in the mail header.  For the life of me, I
> can't find a command line option or configuration file option to make
> mail or pine insert this line.  If I add the line to my html, it is
> ignored because there is a space between the authentic header
> information and my addition.  If I edit the mail on my linux
> mailserver, delete the space and then pop the mail into Outlook, it
> pulls up fine.  I tried another Linux mailing list and all I got was
> lectures about how you shouldn't mail html and html was a bad way to
> do it, etc.  I am not a spammer and have legitimate reasons for
> wanting to do it this way.  Help!

I use html to ensure reasonably correct formatting of email too, for
completely wholesome and respectable reasons. In my case the html is
merely <html><body><pre> report printed to a file </pre><body><html>

the answer is simply that mail & pine do not offer the functionality you
want. nor does almost any other text mail client I can think of.

what you have to do is create _all_ the headers yourself, and feed the
headers, emptyline, data, to sendmail.

it's easy, I'll show you a simple example right here, and you can just
expand on it by looking at the full headers of existing emails in your
mail client.

create a file like so (name doesn't matter, but if you do name it .eml,
then windows boxes will also pop it up loaded into the default mail client
if you click on it on a web page or a samba share...):

test.eml
----------------snip---------------
From: [email protected]
To: [email protected]
Subject: this is a test
Content-Type: text/html

<html></body>
<b>HTML</b> is just a tool that can be used or abused like any other.<br>
It's not <font color=green>good</font> or <font color=red>bad</font>.
</body></html>
----------------snip---------------

now just feed this into sendmail like so:

cat test.eml |sendmail -t -i

That's all there is to it. you can generate a file like that *easy* and
there are several easy things you can put in the header easy, just by
looking at the full headers of exiting mails.

here's a few,

Reply-To: [email protected]
causes well-behaved mail clients to use this address when the user says
"reply"

Disposition-Notification-To: [email protected]
causes a read-receipt to be sent to this address if the readers client and
the reader agree to do it.

X-Priority: 1
causes a little red exclamation mark next to the mail in th efolder list
in outlook express/outlook/maybe others.


in my case I just want the <pre> tag as thats the slickjest way I have
come up with to cause print-to-file reports to look sane in the readers
client, without having to try to tell thousands of my customers customers
and vendors to reconfigure their email clients. sane being "rendered with
a fixed-width font". My customers mailing out proper looking invoices and
various status reports ftp with merely three words of html prepended and
appended, and the rest of the data untouched plain text, that's not evil
just because it's html.

Brian K. White  --  [email protected]  --  http://www.aljex.com/bkw/
+++++[>+++[>+++++>+++++++<<-]<-]>>+.>.+++++.+++++++.-.[>+<---]>++.
filePro BBx  Linux SCO  Prosper/FACTS AutoCAD  #callahans Satriani
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.