I am writing a script that needs to send an e-mail through the PHP mail function. As it is written below, it works when sending an e-mail to a gmail account, but not an account on my domain. We are running an Exchange server. As of now, the e-mails are sent from _www@server. Does anyone know of an issue with php mail and Exchange (or maybe even e-mail addresses beginning with an underscore and Exchange??)? Or perhaps there is another issue here? The mail function will return true no matter what.
Thank you,
Jeff
$user = $_POST['email'];
$to = "someone@domain.org";
$subject = "Request to Reset EduTube Password";
$body = "Thank you " . $_POST['email'] . " for using the EduTube Password Reset System.\n\n";
$body .= "Please click the following link, or copy & paste it into your browser to reset your password.\n\n";
$body .= "http://testing.domain.org/reset.php?user=" . $user;
$headers = "From: someone@domain.org";
$from = "EduTube Password Reset System";
if (mail($to, $subject, $body, $headers)){
echo "Your email has been sent. Please check your inbox shortly.";
echo "<br/><a href='http://testing.domain.org'>Click</a>";
}