3 Replies Latest reply on Apr 21, 2016 12:45 PM by Chris W. Griffith

    my email will not process

    Redmambu

        <form action="" id="form" method="post" name="form">

      <input name="vname" placeholder="Your Name" type="text" value="">

      <input name="vemail" placeholder="Your Email" type="email" value="">

      <input name="sub" placeholder="Subject" type="text" value="">

      <label>Your Question or Request</label>

      <textarea name="msg" placeholder="Type your text here..."></textarea>

      <input id="send" name="submit" type="submit" value="Send Question">

      </form>

      <h3><?php include "secure_email_code.php"?></h3>

       

      <?php

      if(isset($_POST[“submit”])){

      // Checking For Blank Fields..

      if($_POST[“vname”]==””||$_POST[“vemail”]==””||$_POST[“msg”]==””){

      echo “You forget a field”;

      }else{

      // Check if the “Sender’s Email” input field is filled out

      $email=$_POST[‘vemail’];

      // Sanitize E-mail Address

      $email =filter_var($email, FILTER_SANITIZE_EMAIL);

      // Validate E-mail Address

      $email= filter_var($email, FILTER_VALIDATE_EMAIL);

      if (!$email){

      echo “Invalid email adres”;

      }

      else{

      $to = $_POST[‘vname’];

      $message = $_POST[‘msg’];

      $headers = ‘From:’. $email . “\r\n”; // Sender’s Email

      $headers .= ‘Cc:’. $email . “\r\n”; // Carbon copy to Sender

      // Message lines should not exceed 70 characters (PHP rule), so wrap it

      $message = wordwrap($message, 70);

      // Send Mail By PHP Mail Function

      mail(your@email.com”, $headers, $message, $to);

      echo “Thank you for your message, I’ll try to respond as soon as possible!”;

      }

      }

      }