Jump to content

Trouble with contact form


HSD

Recommended Posts

Ok new to php. And I have made these forms work before.

 

The contact form will register my mailer.php page and gives a confirmation message, but doesn't send the email. I have checked the email address and it is correct. Feeling like I am missing something simple here. Please help

 

thanks in advance....

 

 

<?php
if(isset($_POST['submit'])) {

$to = "[email protected]";
$subject = "Message For WSC";
$name_field = $_POST['name'];
$email_field = $_POST['email'];
$phone_field = $_POST['phone'];
$message = $_POST['message'];

$body = "From: $name_field\n E-Mail: $email_field\n Phone: $phone_field\n Message:\n $message";

echo "Thanks! Your email has been sent to us. We will be in contact soon.";
mail($to, $subject, $body);

} else {

echo "There was an error. Please resubmit your email again. Thanks.";

}
?>		




Link to comment
https://forums.phpfreaks.com/topic/206181-trouble-with-contact-form/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.