At Thu Dec 18 12:03:19 2003, Martin, Jeremy wrote: > > By the way, I changed it a bit at the bottom to use html tables to > make it a bit more readable. Thought I'd post what I came up with > here in case anyone wanted to try it out. > > I'm using a little shell script as follows to save the output of the > report script to a .html file, then emailing it to myself as an > attachment using the "email" program from > http://email.cleancode.org/. > > If anyone knows a way to send an email from the command with an html > body (using Linux of course) I'd love to hear it, though it's not > too much of a pain to open the attachment. I tried just saving the > html file with the content-type html line at the top, but when > piping it to /bin/mail it still showed up as a text message in my > email client for some reason.
You need to get the information about the format into the headers; something like this might be a starting point: #!/bin/sh ( cat<<EOF From: [EMAIL PROTECTED] To: [EMAIL PROTECTED] Subject: SpamAssassin report MIME-Version: 1.0 Content-type: text/html; charset=iso-8859-1 EOF /root/bin/Report_spam.pl /var/log/maillog ) | /usr/lib/sendmail -t The "-t" flag to sendmail tells it to parse the headers to get the recipient addresses. The is a quick hack, but works with my very limited testing. Martin -- Martin Radford | "Only wimps use tape backup: _real_ [EMAIL PROTECTED] | men just upload their important stuff -o) Registered Linux user #9257 | on ftp and let the rest of the world /\\ - see http://counter.li.org | mirror it ;)" - Linus Torvalds _\_V ------------------------------------------------------- This SF.net email is sponsored by: IBM Linux Tutorials. Become an expert in LINUX or just sharpen your skills. Sign up for IBM's Free Linux Tutorials. Learn everything from the bash shell to sys admin. Click now! http://ads.osdn.com/?ad_id=1278&alloc_id=3371&op=click _______________________________________________ Spamassassin-talk mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/spamassassin-talk