[SOLVED]Mail() problem
Posted: Tue Jan 11, 2005 8:36 am
Could you help out with the following? I am getting this error:
The code for mailing is as follows:
Line 410 is the last line, the one with mail() in it. $eMail, $game and $AUTOMATED_EMAIL are all correctly set.
I am using almost identical code elsewhere (subject and mail body are different), with no errors. Hopefully it's an obvious error that I'm just not seeing due to staring at it for too long!
Thanks
(scriptname/path changed for security)Warning: mail(): "sendmail_from" not set in php.ini or custom "From:" header missing in path_to_script.php on line 410
The code for mailing is as follows:
Code: Select all
$mailBody .= "Your King/Queen has been slain in the following game:\n\n";
$mailBody .= $game->getDescription();
$mailBody .= " on day " . $game->getDay() . "\n\n";
$mailBody .= "Better luck next time!";
$mailBody .= "THIS IS AN AUTOMATED MESSAGE - PLEASE DO NOT REPLY TO THIS EMAIL\n";
$mailBody .= "(All correspondence sent to this e-Mail address will be ignored)\n\n";
$mailHeaders = "From: " . $AUTOMATED_EMAIL . "\r\n"; // From address
$mailHeaders .= "Reply-To: " . $AUTOMATED_EMAIL . "\r\n"; // Reply-to address
$mailTo = $eMail;
$mailSubject = htmlspecialchars("The end has come in: " . $game->getDescription());
mail($mailTo, $mailSubject, htmlspecialchars($mailBody), $mailHeaders);I am using almost identical code elsewhere (subject and mail body are different), with no errors. Hopefully it's an obvious error that I'm just not seeing due to staring at it for too long!
Thanks