In my website, I have a little contact form that uses PHP to send a mail to my personal e-mail address. In the form, I ask the user for his e-mail address. If the address exists, the script works perfectly, and will receive the message very quickly. But if the user enters a wrong mail address, I won't never receive it. Is it normal ? Here is a little piece of my script...
/* Prepare Email Subject */
$email_subject = '[CONTACT FORM]' . "\t" . $title;
/* Prepare Email Message */
$email_message .= "Nom: ".clean_string($name)."
";
$email_message .= "Email: ".clean_string($email)."
";
$email_message .= "Telephone: ".clean_string($tel)."
";
$email_message .= "Message: ".clean_string($msg)."
";
/* Prepare Email Header */
$headers = 'From: '.$email."
".
'Reply-To: '.$email."
" .
'X-Mailer: PHP/' . phpversion();
/* Send Email and redirect */
mail($email_to, $email_subject, $email_message, $headers);
header ('location: /?status=success#contact');
I would like to thank you all for your answers. I am very sorry if the problem isn't clear enough, and I hope my english is understandable (I'm a Frenchy) !
For those who don't understand what is my problem :
In my script, I put the user's mail adress in the mail header. If the user gives me a valid e-mail, then I will receive the message, otherwise I won't.
Don't worry about the variables, this is just the last part of my script, but I verify all of them.
When I said "only if the address exists", I really wanted to mean that apparently, if the address is not registered, or if the domain does not exists, it does not work. Before sending the mail, I verify if the address is "valid" by applying a Regex test. And if I enter, for example : abcde@aeaefa.fr I won't receive the mail. That's why it is weird, the mail address format is good.
blue112, I am going to create a postmaster address, and use it to send these mails.