我想向客户发送邮件,谢谢你的回复。请帮我怎么送? 在这里,我发送代码,请检查代码。
<? 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");
}
}
?>
我想感谢您回复电子邮件给客户。请帮助我。感谢。
答案 0 :(得分:0)
在邮件if
条件中添加此邮件代码。
$thanks_message = 'Some Message';
mail($_POST['Email'], "Thanks for contacting us", $thanks_message,"From: PotterHandy.com <info@potterhandy.com>");