mardi 11 août 2015

Php mail() not working suddenly [duplicate]

This question already has an answer here:

My code was running fine but Lately I am not receiving mails from the code. Here is my code.

$email_to = "xxx@gmail.com";
$email_subject = "subject : xxx";
$name = $_POST['name']; 
$phone = $_POST['phone']; 
$email = $_POST['email']; 
$respondto = $_POST['email'];


$email_message .= "Name: ".clean_string($name)."\n";
$email_message .= "Mobile: ".clean_string($phone)."\n";
$email_message .= "Email: ".clean_string($email)."\n";
$email_subject_res = "order";
$response_mesage = "Hey!\nThanks for placing the order.".clean_string($email_message). "\n\nWe will get in touch with you shortly.\n\n\nBest ";
$res_bcc = "xxx@gmail.com";
$res_from = "no-reply@myurldomain.com";

// create email headers

$headers = 'From: '.$email."\r\n" .
'Reply-To: '.$email."\r\n" .
'X-Mailer: PHP/' . phpversion();
@mail($email_to, $email_subject, $email_message, $headers);
$headersres = 'FROM: '.$res_from."\r\n" .
'BCC: '.$res_bcc."\r\n" .
'X-Mailer: PHP/' . phpversion();
@mail($respondto, $email_subject_res, $response_mesage, $headersres);
header("Location: http://ift.tt/1JbMT8g!!!");
echo 'THANK YOU '.$name.' . Your E-Mail has been sent. We will get back to      you at the earliest';  

//Insert to database
mysql_query("INSERT INTO `Orders`(`Name`,`Contact`,`Email`,) VALUES ('$name','$phone','$email')");

}
else{
 header("Location: http://ift.tt/1IJEhjH!!!");
echo 'error';
}

I have emptied my no-reply@myurldomain.com inbox . And I am receiving the data into my database. Thus I am fetching all the data. Something seems to be wrong with the mail function.




Aucun commentaire:

Enregistrer un commentaire