I am running the cron job where there is html formatted output. I want to send that output my email address in html format.
Is there any way to do that
php /home/bla/bla_bla.php | mail -s "Bla Bla" -s "bla@bla.com"
|
|
|
You might want to take a look at mime-construct. It's handy for just this kind of thing. I use it to send a generated HTML doc as part of a daily cronjob like so:
If you don't care about the messages being multipart, you can drop that portion. It can also take the html via stdin like so:
I don't know what distro you're using, but this is available in the main repositories for Debian and Ubuntu, I would imagine RHEL and derivatives likely have it too. |
|||
|
|
Add a Content-Type header such as |
|||||
|