Sunday, June 22, 2008

Linux Mail

Mime headers

Want to send mail using /usr/bin/mail that has html encoding? Then use the -a switch.

sh commandwithoutput | mail -s "Subject here" -a "Content-Type: text/html;" user@yourmail.com

If you want this output from the crontab then you must pipe the output of each command as above.

* * * mythtv sh /myth/bin/emailrecordings | mail -s "Daily myth recordings" -a "Content-Type: text/html;" user@yourmail.com

No comments: