I'm trying to build a plain text email in a PHP script. I've done this successfully in another script but this new one fails and I need some help figuring out how to debug it. The crux of the problem is that the local mailer rejects the message saying there is no receipient. When I look at the bounced message, there most certainly is a receipient and it is valid. The error must be talking about something else but I can't figure out what. Here is the code segment:
Can anyone see what I'm doing wrong or suggest a debug technique? TIA.
Code:
$sendto="myuserid@mydomain.com";
$headers="From: someone@mydomain.com\r\n";
$headers.="Date: ".date("m/d/Y")."\r\n";
$headers.="CC: someoneelse@mydomain.com\r\n";
$headers.="Content-type: text/plain\r\n");
$subject="Test message from PHP";
$body="blah blah blah";
mail($sendto,$subject,$body,$headers);