It seems to me that you need a couple of other things:

1. a look at a couple of the html emails in my inbox show a mail
header (ie part of the email where stuff like from, to and subject go) like 
this:

MIME-Version: 1.0
Content-Type: multipart/alternative;
        boundary="----_=_NextPart_001_01C5B8D9.821B04F0"

you can add extra headers using the mail command with the -a parameter 
(according to man mail)

" -a      Specify additional header fields on the command line such as "X-Loop: 
[EMAIL PROTECTED]" etc.  You have to use
             quotes if the string contains spaces.  This argument may be 
specified more than once, the headers
             will then be concatenated."

2. The body of the message must be in mime format using the same "boundary" as 
is specified in the header like this:

------_=_NextPart_001_01C5B8D9.821B04F0
Content-Type: text/plain
(here is the text part of the message)

------_=_NextPart_001_01C5B8D9.821B04F0
Content-Type: text/html
Content-Transfer-Encoding: quoted-printable

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
<HTML> (all the html bits)
</HTML>

below that the boundary is specified again:

------_=_NextPart_001_01C5B8D9.821B04F0--

(thats the very last line in the file)


3. i tried using mpack to make an html message from the command line,
but it didn't work - I might be doing something wrong.


On Fri, 16 Sep 2005 07:07:23 +0800
Ow Mun Heng wrote:

> Hi,
> 
>       I'm writing a bash script that basically checks for stocks prices and I
> want the formatted output to be mailed to me. I've got the script
> working already. The only problem is the HTML is well, not displayed as
> HTML, it's displayed RAW(and not formatted).
> 
> I'm using cron to send the email out.
> 
> I've even put the echo statement :
> 
> html_header()
> {
>         echo "Content-Type: text/html; charset=iso-8859-1"
>         echo "<HTML><HEAD><TITLE>Stock Quotes :" $DATE "</TITLE></HEAD>"
>         echo '<STYLE TYPE="TEXT/CSS">'
>         echo "h1 {color: gray; border-bottom: 3px double silver}"
>         echo "h2,h3 {color: gray; border-bottom: 1px solid silver}"
>         echo "</STYLE></HEAD>"
>         echo "<BODY>"
>         echo "<H1>Stock Quotes :" $DATE "</H1>"
>         echo "<BR><BR>"
> }
> 
> 
> but all I get is :
> 
> Content-Type: text/html; charset=iso-8859-1
> <HTML><HEAD><TITLE>Stock Quotes : Fri Sep 16 06:52:02 2005
> </TITLE></HEAD>
> <STYLE TYPE="TEXT/CSS">
> h1 {color: gray; border-bottom: 3px double silver}
> h2,h3 {color: gray; border-bottom: 1px solid silver}
> </STYLE></HEAD>
> <BODY>
> <H1>Stock Quotes : Fri Sep 16 06:52:02 2005 </H1>
> <BR><BR>
> 
> What sort of "content-type" do I need to put into it? or do I have to
> format the message and use sendmail -t < quote
> 
> 
> -- 
> Ow Mun Heng
> Gentoo/Linux on DELL D600 1.4Ghz 1.5GB RAM
> 98% Microsoft(tm) Free!! 
> Neuromancer 07:03:30 up 2 days, 19:38, 6 users, load average: 0.80,
> 0.49, 0.52 
> 
> 
> -- 
> gentoo-user@gentoo.org mailing list

-- 
Nick Rout <[EMAIL PROTECTED]>

-- 
gentoo-user@gentoo.org mailing list

Reply via email to