Sending HTML from PHP with 'mail' as a cron job
| From: | Stefen Lars | Date: | Thu, 11 Apr 2002 07:47:17 +0000 |
| Subject: | Sending HTML from PHP with 'mail' as a cron job | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-92516@lists.php.net to get a copy of this message | ||
Hello all
I have a script called report.php that generates a report in HTML. This report must be created at regular intervals; hence I have set up a cron job to call that script. The output of report.php must be sent by e-mail. I use the following command:
/usr/bin/lynx -source http://server.com/report.php | mail -s "Report" foo@bar.com
This works fine. The result of report.php is sent to foo@bar.com.
However, the results do not appear as HTML in the e-mail client, but as text. This is due to the fact that the headers saying This is HTML are missing from the e-mail message sent.
Does anyone know how it is possible to get 'mail' to add suitable headers to the above command, so that the receiving e-mail client knows that it is getting an HTML and not a text message?
Any help would be gratefully received. TIA.
S.
_________________________________________________________________
Send and receive Hotmail on your mobile device: http://mobile.msn.com