Broken PHP contact form script

dmanuel

New Member
I'm trying to make a contactform.And somehow it won't work.I tried to send a email just with the mail()-function and that works.So I'm doing something wrong and I don't know what.When you click on the submit button, I refer to the mailer.php file.Both file are in the same folder.\[code\]<?phpif(isset($_POST['sendButton'])){ $to = "[email protected]"; $subject = "Contactformulier Portfolio"; $name_field = $_POST['yourName']; $email_field = $_POST['yourEmail']; $message = $_POST['yourMessage']; $body = "From: $name_field\n E-Mail: $email_field\n Message:\n $message"; echo "Data has been submitted to $to!"; mail($to, $subject, $body);}else{ echo "There has been some error, try again please!";}?>\[/code\]
 
Back
Top