mail () not working in PHP 5
Posted: Thu Mar 08, 2007 12:25 pm
I have a mail script that works in PHP4 but its not sending the email in PHP5. Does anyone know why?
Code: Select all
//Form information will be emailed on this Email address.
$to = "retrodog@comcast.net";
$email_body = "Please contact me at the email address below. Thank you!"."\n\n";
$email_body .= "Name: $name"."\n";
$email_body .= "Email Address: $email"."\n";
$mailheaders1 = "MIME-Version: 1.0\r\n";
$mailheaders1 .= "Content-type: text/plain; charset=iso-8859-1\r\n";
$mailheaders1 .= "From: Christ Church\n";
$mailheaders1 .= "Reply-To: ecopeland@christchurch.com";
$mailheaders = "MIME-Version: 1.0\r\n";
$mailheaders .= "Content-type: text/plain; charset=iso-8859-1\r\n";
$mailheaders .= "From: $name \n";
$mailheaders .= "Reply-To: $email";
//And a copy to this email address
$cc = "";
//This will be the subject of email you will recieve on form submission
$subject = "I'm interested in learning more about Christ Church Fellowship";
//--------------------------------------------------//
//A Confirmation Email will be sent automatically to the user who will submit form,
//Write your Auto Email Subject below
$auto_subject = "Thank you for your interest in Christ Church";
//Write your Auto Email Body below
$auto_message = "As a member of Christ Church Fellowship, you will receive our regular email newsletter, Nexus, containing all the church news and updates. We will be contacting you shortly with more information. Thanks for your interest!!";
if(mail($to,$subject,stripslashes($email_body),$mailheaders)) {
//mail($cc,$subject,$email_body,"Reply-To: $email\r\n");
mail($email,$auto_subject,$auto_message,$mailheaders1);
header("Location: jump-in.php?msg=success");
exit;
}
else {
header("Location: jump-in.php?msg=issue");
exit;
}