Question

I want to send a mail to client thanks for your reply. kindly help me how to send? here i am sending the code kindly check the code.

 <? session_start();
    require_once('../includes/recaptchalib.php');
    $privatekey =PRIVATE_KEY;
    $resp = recaptcha_check_answer ($privatekey,
                                $_SERVER["REMOTE_ADDR"],
                                $_POST["recaptcha_challenge_field"],
                                $_POST["recaptcha_response_field"]);

    if (!$resp->is_valid) {
    // What happens when the CAPTCHA was entered incorrectly
    // die ("The reCAPTCHA wasn't entered correctly. Go back and try it again." ."(reCAPTCHA said: " . $resp->error . ")");

          $REF_URL=$_SERVER['HTTP_REFERER'];
          if(strpos($REF_URL, '?v='))
            $URL=$REF_URL;
            else
          $URL=$_SERVER['HTTP_REFERER']."?v=1";
         echo "<meta http-equiv=\"refresh\" content=\"0;url=".$URL."\"/>";

    } else {
    // Your code here to handle a successful verification
    //echo "CAPTCHA verified ";
    foreach ($_REQUEST as $key=>$val){
    $_SESSION['contactvars'][$key] = $val;
    }

    foreach ($_REQUEST as $key=>$var){
    if ($key != 'PHPSESSID' && $key != "__utmz" && $key != "__utma" && $key != "__utmc" && $key != "__utmb"){
        if (is_array($var)){
            foreach ($var as $k=>$v){
                $message .= "$key: $v \n";
                }//each array key
            }//is an array
        else {  
            $message .= "$key: $var \n";
            }//not an array
        }//not phpsessid
    }//each request
    if (mail("mark@potterhandy.com", "Contact request from PotterHandy.com", $message, "From: PotterHandy.com <info@potterhandy.com>" ."\r\n" . "Cc: dave@rewebsitepro.com" .  "\r\n" . "Cc: stan@potterhandy.com" .  "\r\n" . "Cc: michaelhandy@potterhandy.com")){
    unset($_SESSION['contactvars']);
    header("Location: ../requestsent");
    }

     }



    ?>

I want to send thanks for your reply email to client. kindly help me. thanks.

Was it helpful?

Solution

Add this mail code in your mail if condition.

$thanks_message = 'Some Message';
mail($_POST['Email'], "Thanks for contacting us", $thanks_message,"From: PotterHandy.com <info@potterhandy.com>");
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top