Basic Contact form not functioning properly...

Hi All -

I have a basic contact me form that is not pushing the email that I have setup into the PHP file.

Here is my HTML code and PHP code, any assistance is greatly appreciated!!

HTML:

[php]




Name :



Email :



Subject :



Address :



Phone Number :






Message :
    </div></fieldset>
<input type="submit" value="send" />
[/php] (Note: Just formatted the code to make it easier to read) PHP: [php]<?php if(isset($_POST['Name'],$_POST['Email'],$_POST['Subject'],$_POST['Address'],$_POST['Phone'],$_POST['Message'])) { $Name = $_POST['Name']; $E_Mail = $_POST['Email']; $Subject = $_POST['Subject']; $Address = $_POST['Address']; $Phone_Number = $_POST['Phone']; $Message = "$Name\r\n$E_Mail\r\n$Subject\r\n$Address\r\n$Phone_Number\r\n\r\n\r\n"; $Message .= $_POST['Message']; $mail_to_send_to = "email1"; $your_feedbackmail = "email2"; $subject = "Cypress Village Website - Contact Us Form"; $headers = "From:email2" . "\r\n" . "Reply-To: $your_feedbackmail" . "\r\n" . "Name $Name" . "\r\n" ; $a = mail( $mail_to_send_to, "Cypress Village Website Contact Us Message", $Message, $headers ); } else die('You did not enter all required information. Please go back and complete the form.'); ?>[/php]

You are not checking to see if the mail was actually sent.

  1. place the mail function in am if statement to see if it was sent.
  2. Using a mail library is far superior to using the mail() function. PHPMailer, Swift Mail, ect.
Sponsor our Newsletter | Privacy Policy | Terms of Service