Click here to Skip to main content
15,884,628 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I design web page for contact in php, the email which i want to send to it is in google this is my code it's work good the massage' Message successfully sent!' appear but the message not received in the account. any help please.
PHP
$errors = '';
$myemail = 'info@zonebooking.com';//<-----Put Your email address here.
$name =$_POST['name'];
$cmpny = $_POST['cmp'];
$fn= $_POST['fn'];
$email_address = $_POST['email'];
$message = $_POST['message'];

    $email_subject = "Contact form submission: $name";
    $email_body = "You have received a new message. ".
    " Here are the details:\n Name: $name  \n Company Name: $cmpny \n Phone: $fn \n Email: $email_address \n Message \n $message";

    $headers = "From: $email_address\n";
    $headers .= "Reply-To: $email_address";

    if (mail($myemail,$email_subject,$email_body,$headers)) {
echo "Message successfully sent!";
} else {
echo "Message delivery failed...";
}
Posted
Comments
Thomas Daniels 1-Mar-15 12:00pm    
Which web server do you use? You might need to change some configuration.
Samar Daer 1-Mar-15 13:16pm    
the web server is dreamhost
vbmike 1-Mar-15 14:28pm    
It could be in the spam folder on the recipients end?
Samar Daer 1-Mar-15 14:38pm    
no, i check it but nothing received
vbmike 1-Mar-15 15:20pm    
What does the FAQ on dreamhost have to say? Anything?

Here are a few links that explain how to send emails in PHP -
Mail[^]
PHP mail[^]
PHP - sending emails[^]
 
Share this answer
 
First of all, I cannot be sure that your mail server is properly configured with your site or even exist.

But your main problem is not sending mail; sooner or later you'll figure it out. Another thing is much worse: it is badly unsafe. It will be way too easy to turn your host into a zombie spreading spam, or something like that. I'll explain. I explained this trivial exploit in my past answer: unable to send mail , it showing the error in below code .[^].

—SA
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900