On Thu, 2005-09-15 at 20:30 -0500, John Jolet wrote: > On Sep 15, 2005, at 8:14 PM, Ow Mun Heng wrote: > > > On Thu, 2005-09-15 at 20:47 -0400, Willie Wong wrote: > > > >> On Fri, Sep 16, 2005 at 07:07:23AM +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. > >> > >> Try using the mail command.... > >> http://www.debian-administration.org/articles/171 > >> > >> to put it simply: > >> > >> mail -a "Content-type: text/html;" -s "Your Daily Stock Quote" > >> [EMAIL PROTECTED] < filename.html > >> > > > > I tried that. It worked perfectly. Only thing now, I'll have to > > hack the > > script to put the output into a file and send our the file instead of > > using cron. > > > > Should be a simple thing. > > > > > > you could also write a small perl script to actually send the > email....I send out a newsletter that way every week.
That's what I just did.. $ cat cron_fetch_stock.sh #!/bin/bash # TEMPFILE="/tmp/file.$$" PORTFOLIO_SCRIPT=$HOME/scripts/portfolio.sh $PORTFOLIO_SCRIPT --html > $TEMPFILE 2>/dev/null>&1 && mail -a "Content-Type: text/html" -s "Stock Quotes `date +%c`" < $TEMPFILE gentoo && rm $TEMPFILE -- Ow Mun Heng Gentoo/Linux on DELL D600 1.4Ghz 1.5GB RAM 98% Microsoft(tm) Free!! Neuromancer 09:42:48 up 2 days, 22:17, 7 users, load average: 1.06, 0.86, 1.06 -- gentoo-user@gentoo.org mailing list