Jump to content

NicoleStrain

New Members
  • Posts

    2
  • Joined

  • Last visited

NicoleStrain's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. Hello thanks for replying, I hadnt realized that i was missing the body tag, ive been playing about with that much ive deleted it at one point by accident. I got the code from a demo file offline which i altered to my contact from so being completely honest im not sure what died() or $email_exp is used for. Ill take your advice but and stick to a plan text email until ive learned more, would rather have an email that works instead of one that looks good.
  2. Hello I have a PHP contact from for a website im making. The form is sending the email ok however the content in the email is wrong as its sending the HTML script. Im only using Notepad ++ to make the website and that dosent have a error checker so i used a website called http://phpcodechecker.com/ but that said there is no errors in my code which there must be. Could someone have a check for me please ? This is my first time using PHP so it probably a silly mistake. Thanks in advanced ! <?php if(isset($_POST['email'])) { // CHANGE THE TWO LINES BELOW $email_to = "[email protected]"; $email_subject = "Website Bookin"; function died($error) { // your error code can go here echo "We're sorry, but there's errors found with the form you submitted.<br /><br />"; echo $error."<br /><br />"; echo "Please go back and fix these errors.<br /><br />"; die(); } $name = $_POST['name']; $email_address = $_POST['email']; $tell = $_POST['tell']; $date = $_POST['date']; $service = $_POST['service']; $eMessage = $_POST['message']; $error_message = ""; $email_exp = '/^[A-Za-z0-9._%-]+@[A-Za-z0-9.-]+\.[A-Za-z]{2,4}$/'; $message = ' <html> <head> <p> You have received a new booking request. <br/> Name: $name <br/> Email: $email_address <br/> Tell: $tell <br/> Date: $date <br/> Service: $tell <br/> Message: $eMessage </p> </body> </html> '; // create email headers $headers = 'From: '.$email_from."\r\n". 'Reply-To: '.$email_from."\r\n" . 'X-Mailer: PHP/' . phpversion(); mail($email_to, $email_subject,$message,$headers); ?> <!-- place your own success html below --> Thank you for contacting us. We will be in touch with you very soon. <?php } die(); ?>
×
×
  • 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.