From Ow.Mun.Heng at wdc.com Fri Jun 5 15:16:30 2015 Content-Type: multipart/mixed; boundary="===============3698218104699834497==" MIME-Version: 1.0 From: Ow Mun Heng To: users at lists.fedoraproject.org Subject: Help with Script that sends out HTML emails Date: Fri, 16 Sep 2005 08:52:55 +0800 Message-ID: <1126831975.13180.1.camel@neuromancer.home.net> --===============3698218104699834497== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable 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=3Diso-8859-1" echo "Stock Quotes :" $DATE "" echo '" echo "" echo "

Stock Quotes :" $DATE "

" echo "

" } but all I get is : Content-Type: text/html; charset=3Diso-8859-1 Stock Quotes : Fri Sep 16 06:52:02 2005

Stock Quotes : Fri Sep 16 06:52:02 2005



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 08:52:35 up 2 days, 21:27, 5 users, load average: 1.69, 7.60, 5.86 = --===============3698218104699834497==-- From mrsam at courier-mta.com Fri Jun 5 15:16:30 2015 Content-Type: multipart/mixed; boundary="===============6737259051989797547==" MIME-Version: 1.0 From: Sam Varshavchik To: users at lists.fedoraproject.org Subject: Re: Help with Script that sends out HTML emails Date: Thu, 15 Sep 2005 21:02:43 -0400 Message-ID: In-Reply-To: 1126831975.13180.1.camel@neuromancer.home.net --===============6737259051989797547== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable 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=3Diso-8859-1" > echo "Stock Quotes :" $DATE "" > echo '" > echo "" > echo "

Stock Quotes :" $DATE "

" > echo "

" > } > = > = > but all I get is : > = > Content-Type: text/html; charset=3Diso-8859-1 > Stock Quotes : Fri Sep 16 06:52:02 2005 > > > >

Stock Quotes : Fri Sep 16 06:52:02 2005

>

> = > 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. --===============6737259051989797547== Content-Type: application/pgp-signature MIME-Version: 1.0 Content-Transfer-Encoding: base64 Content-Disposition: attachment; filename="attachment.sig" LS0tLS1CRUdJTiBQR1AgU0lHTkFUVVJFLS0tLS0KVmVyc2lvbjogR251UEcgdjEuMi43IChHTlUv TGludXgpCgppRDhEQlFCREtobXp4OXAzR1lIbFVPSVJBbjI1QUo5YmhiODJnYUhXV3ozOS9YeFlX VUZlUFBmNkpnQ2ZYdHl3CmNtY2hVN3BXcEFXR1l1b1dZZmRFMVc4PQo9TjJhQwotLS0tLUVORCBQ R1AgU0lHTkFUVVJFLS0tLS0K --===============6737259051989797547==-- From Ow.Mun.Heng at wdc.com Fri Jun 5 15:16:30 2015 Content-Type: multipart/mixed; boundary="===============5229142835120423345==" MIME-Version: 1.0 From: Ow Mun Heng To: users at lists.fedoraproject.org Subject: Re: Help with Script that sends out HTML emails [SOLVED] Date: Fri, 16 Sep 2005 09:40:14 +0800 Message-ID: <1126834815.13180.15.camel@neuromancer.home.net> In-Reply-To: cone.1126832563.475034.7718.500@commodore.email-scan.com --===============5229142835120423345== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable On Thu, 2005-09-15 at 21:02 -0400, Sam Varshavchik wrote: > 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=3Diso-8859-1" > > echo "Stock Quotes :" $DATE "" > 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. I think I've tried that as well. The Mime-Version gets appended automatically. Even doing an uuencode and sending the resultant file doesn't have it as an attachment. In any case, it's solved using = mail -a "Content-Type: text/html" -- = Ow Mun Heng Gentoo/Linux on DELL D600 1.4Ghz 1.5GB RAM 98% Microsoft(tm) Free!! = Neuromancer 09:36:35 up 2 days, 22:11, 8 users, load average: 1.87, 0.85, 1.16 = --===============5229142835120423345==-- From lesmikesell at gmail.com Fri Jun 5 15:16:32 2015 Content-Type: multipart/mixed; boundary="===============3253132378197531077==" MIME-Version: 1.0 From: Les Mikesell To: users at lists.fedoraproject.org Subject: Re: Help with Script that sends out HTML emails Date: Thu, 15 Sep 2005 22:50:38 -0500 Message-ID: <1126842637.611.13.camel@les-home.futuresource.com> In-Reply-To: 1126831975.13180.1.camel@neuromancer.home.net --===============3253132378197531077== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable On Thu, 2005-09-15 at 19:52, 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). You need to add MIME headers. This might be the easy way: http://search.cpan.org/~jenda/Mail-Sender-0.8.10/Sender.pm -- = Les Mikesell lesmikesell(a)gmail.com --===============3253132378197531077==-- From Ow.Mun.Heng at wdc.com Fri Jun 5 15:17:08 2015 Content-Type: multipart/mixed; boundary="===============8565243220746356865==" MIME-Version: 1.0 From: Ow Mun Heng To: users at lists.fedoraproject.org Subject: Re: Help with Script that sends out HTML emails [NOT-SOLVED-Agn] Date: Sat, 17 Sep 2005 20:44:41 +0800 Message-ID: <1126961081.22611.17.camel@neuromancer.home.net> In-Reply-To: 1126834815.13180.15.camel@neuromancer.home.net --===============8565243220746356865== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable On Fri, 2005-09-16 at 09:40 +0800, Ow Mun Heng wrote: > On Thu, 2005-09-15 at 21:02 -0400, Sam Varshavchik wrote: > > 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=3Diso-8859-1" > > > echo "Stock Quotes :" $DATE "" > = > > 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. > = > I think I've tried that as well. The Mime-Version gets appended > automatically. Even doing an uuencode and sending the resultant file > doesn't have it as an attachment. > = > In any case, it's solved using = > = > mail -a "Content-Type: text/html" Okay.. for some reason, FC3's version of mailx (8.1.33) does not have the "-a" option to mail. Any other ideas? -- = Ow Mun Heng Gentoo/Linux on DELL D600 1.4Ghz 1.5GB RAM 98% Microsoft(tm) Free!! = Neuromancer 20:43:54 up 1 day, 43 min, 3 users, load average: 0.49, 0.43, 0.63 = --===============8565243220746356865==-- From mrsam at courier-mta.com Fri Jun 5 15:17:09 2015 Content-Type: multipart/mixed; boundary="===============2859492810763055144==" MIME-Version: 1.0 From: Sam Varshavchik To: users at lists.fedoraproject.org Subject: Re: Help with Script that sends out HTML emails [NOT-SOLVED-Agn] Date: Sun, 18 Sep 2005 22:44:00 -0400 Message-ID: In-Reply-To: 1126961081.22611.17.camel@neuromancer.home.net --===============2859492810763055144== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Ow Mun Heng writes: > On Fri, 2005-09-16 at 09:40 +0800, Ow Mun Heng wrote: >> On Thu, 2005-09-15 at 21:02 -0400, Sam Varshavchik wrote: >> > 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=3Diso-8859-1" >> > > echo "Stock Quotes :" $DATE "" >> = >> > 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. >> = >> I think I've tried that as well. The Mime-Version gets appended >> automatically. Even doing an uuencode and sending the resultant file >> doesn't have it as an attachment. >> = >> In any case, it's solved using = >> = >> mail -a "Content-Type: text/html" > = > Okay.. for some reason, FC3's version of mailx (8.1.33) does not have > the "-a" option to mail. > = > Any other ideas? You can format the entire mail message yourself, and pipe it to sendmail. = That's all that mailx, itself, does anyway. Consider this as an opportunity for you to learn about proper E-mail = formats. --===============2859492810763055144== Content-Type: application/pgp-signature MIME-Version: 1.0 Content-Transfer-Encoding: base64 Content-Disposition: attachment; filename="attachment.sig" LS0tLS1CRUdJTiBQR1AgU0lHTkFUVVJFLS0tLS0KVmVyc2lvbjogR251UEcgdjEuMi43IChHTlUv TGludXgpCgppRDhEQlFCRExpWHd4OXAzR1lIbFVPSVJBbGhUQUo0L240NHptdkRNMXgvZkYrTFBD SXVLNXdQNDF3Q2VPb0hZClNUaHJJcnlNNTJWM3Q0ZGhNQ1UyTTA4PQo9ZDQ4QQotLS0tLUVORCBQ R1AgU0lHTkFUVVJFLS0tLS0K --===============2859492810763055144==-- From Ow.Mun.Heng at wdc.com Fri Jun 5 15:17:09 2015 Content-Type: multipart/mixed; boundary="===============3812843261896891615==" MIME-Version: 1.0 From: Ow Mun Heng To: users at lists.fedoraproject.org Subject: Re: Help with Script that sends out HTML emails [NOT-SOLVED-Agn] Date: Mon, 19 Sep 2005 10:52:06 +0800 Message-ID: <1127098326.17432.29.camel@neuromancer.home.net> In-Reply-To: cone.1127097840.961829.6151.500@commodore.email-scan.com --===============3812843261896891615== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable On Sun, 2005-09-18 at 22:44 -0400, Sam Varshavchik wrote: > Ow Mun Heng writes: > = > > On Fri, 2005-09-16 at 09:40 +0800, Ow Mun Heng wrote: > >> On Thu, 2005-09-15 at 21:02 -0400, Sam Varshavchik wrote: > >> > 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 > >> mail -a "Content-Type: text/html" > > = > > Okay.. for some reason, FC3's version of mailx (8.1.33) does not have > > the "-a" option to mail. > > = > > Any other ideas? > = > You can format the entire mail message yourself, and pipe it to sendmail.= = > That's all that mailx, itself, does anyway. > = > Consider this as an opportunity for you to learn about proper E-mail = > formats. Believe it or not, I've actually done this before, but using mail -a would have been a simpler matter comparatively. :-( -- = Ow Mun Heng Gentoo/Linux on DELL D600 1.4Ghz 1.5GB RAM 98% Microsoft(tm) Free!! = Neuromancer 10:52:05 up 1:09, 6 users, load average: 1.04, 0.63, 0.58 = --===============3812843261896891615==-- From Ow.Mun.Heng at wdc.com Fri Jun 5 15:17:23 2015 Content-Type: multipart/mixed; boundary="===============7086244118722177923==" MIME-Version: 1.0 From: Ow Mun Heng To: users at lists.fedoraproject.org Subject: Re: Help with Script that sends out HTML emails [SOLVED-Agn] Date: Tue, 20 Sep 2005 09:46:16 +0800 Message-ID: <1127180776.25800.29.camel@neuromancer.home.net> In-Reply-To: 1127098326.17432.29.camel@neuromancer.home.net --===============7086244118722177923== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable On Mon, 2005-09-19 at 10:52 +0800, Ow Mun Heng wrote: > On Sun, 2005-09-18 at 22:44 -0400, Sam Varshavchik wrote: > > >> > > I'm writing a bash script that basically checks for stoc= ks > > >> > > prices and I > > >> > > want the formatted output to be mailed to me. I've got the script > = > > >> mail -a "Content-Type: text/html" > > > = > > > Okay.. for some reason, FC3's version of mailx (8.1.33) does not have > > > the "-a" option to mail. > > You can format the entire mail message yourself, and pipe it to sendmai= l. = > > = > > Consider this as an opportunity for you to learn about proper E-mail = > > formats. > = > Believe it or not, I've actually done this before, but using mail -a > would have been a simpler matter comparatively. :-( Done.. I added a mail_header to my script that does.. mail_header() { echo "MIME-Version:1.0" echo "From:No-Reply(a)no-reply.com" echo "To:$RECIPIENT" echo "Subject:Quotes $DATE" echo "Content-Type: text/html" echo } and then I added a script for cron = #!/bin/sh # TEMPFILE=3D"/tmp/file.$$" PORTFOLIO_SCRIPT=3D$HOME/scripts/portfolio.sh $PORTFOLIO_SCRIPT --html > $TEMPFILE 2>/dev/null>&1 && /usr/sbin/sendmail -t < $TEMPFILE && rm $TEMPFILE Next, I think the above code can be enhanced by not using a tempfile. perhaps a < EOF = -- = Ow Mun Heng Gentoo/Linux on DELL D600 1.4Ghz 1.5GB RAM 98% Microsoft(tm) Free!! = Neuromancer 09:43:41 up 1 day, 1 min, 6 users, load average: 2.44, 2.13, 2.20 = --===============7086244118722177923==-- From mrsam at courier-mta.com Fri Jun 5 15:17:23 2015 Content-Type: multipart/mixed; boundary="===============5068915550905495214==" MIME-Version: 1.0 From: Sam Varshavchik To: users at lists.fedoraproject.org Subject: Re: Help with Script that sends out HTML emails [SOLVED-Agn] Date: Mon, 19 Sep 2005 22:26:54 -0400 Message-ID: In-Reply-To: 1127180776.25800.29.camel@neuromancer.home.net --===============5068915550905495214== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Ow Mun Heng writes: > = > $PORTFOLIO_SCRIPT --html > $TEMPFILE 2>/dev/null>&1 > && /usr/sbin/sendmail -t < $TEMPFILE && rm $TEMPFILE > = > Next, I think the above code can be enhanced by not using a tempfile. > perhaps a < EOF = Use a pipe: $PORTFOLIO_SCRIPT --html | /usr/sbin/sendmail -t --===============5068915550905495214== Content-Type: application/pgp-signature MIME-Version: 1.0 Content-Transfer-Encoding: base64 Content-Disposition: attachment; filename="attachment.sig" LS0tLS1CRUdJTiBQR1AgU0lHTkFUVVJFLS0tLS0KVmVyc2lvbjogR251UEcgdjEuMi43IChHTlUv TGludXgpCgppRDhEQlFCREwzTnV4OXAzR1lIbFVPSVJBcm1xQUo0aXZnTFRvc1NjOEo4bHIwNnA5 eWVXTkxjM1dnQ2VNdDI4CjN0elhhU1NpQy9idDRPZURWV3VCOUNZPQo9NDlPZgotLS0tLUVORCBQ R1AgU0lHTkFUVVJFLS0tLS0K --===============5068915550905495214==-- From Ow.Mun.Heng at wdc.com Fri Jun 5 15:17:24 2015 Content-Type: multipart/mixed; boundary="===============2133051308722870679==" MIME-Version: 1.0 From: Ow Mun Heng To: users at lists.fedoraproject.org Subject: Re: Help with Script that sends out HTML emails [SOLVED-Agn] Date: Tue, 20 Sep 2005 11:31:12 +0800 Message-ID: <1127187073.25800.51.camel@neuromancer.home.net> In-Reply-To: cone.1127183214.482222.25517.500@commodore.email-scan.com --===============2133051308722870679== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable On Mon, 2005-09-19 at 22:26 -0400, Sam Varshavchik wrote: > Ow Mun Heng writes: > = > > = > > $PORTFOLIO_SCRIPT --html > $TEMPFILE 2>/dev/null>&1 > > && /usr/sbin/sendmail -t < $TEMPFILE && rm $TEMPFILE > > = > > Next, I think the above code can be enhanced by not using a tempfile. > > perhaps a < EOF = > = > Use a pipe: > = > $PORTFOLIO_SCRIPT --html | /usr/sbin/sendmail -t Yep.. I did try that. It worked on my gentoo system, but IIRC it didn't on my FC3 system. Will try again. -- = Ow Mun Heng Gentoo/Linux on DELL D600 1.4Ghz 1.5GB RAM 98% Microsoft(tm) Free!! = Neuromancer 11:30:31 up 1 day, 1:48, 6 users, load average: 0.94, 0.59, 0.61 = --===============2133051308722870679==--