[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

Re: Help with Script that sends out HTML emails



Ow Mun Heng writes:

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

There are at least two structural problems with your message.

1) There is no blank line that separates mail headers from body.

2) The Mime-Version: header is missing.

Attachment: pgpGp4YX7cuLE.pgp
Description: PGP signature


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]