I am trying to invoke sendmail via PHP\'s mail function by the following code:
$to = \'blah@email.state.edu\';
$subject = \'test\';
$message = \
Although this is an old question, I'm adding this answer in case it is of help to someone:
I had the same problem with the From: header being re-written to www-data@host... I eventually tracked it down to the ssmtp bridge service that was piping mail from our web server into our mailserver. I added the line FromLineOverride=YES in the file /etc/ssmtp/ssmtp.conf and the problem disappeared.