7
我想添加一個回覆地址到我的PHP郵件程序,它只是從「我」和回覆我的地址。phpmailer不能添加回復地址
任何想法我做錯了什麼?我添加了$ mail-> AddReplyTo。我希望它回覆網頁表單的發件人。
$name = $_POST['name'];
$telephone = $_POST['telephone'];
$email = $_POST['email'];
$message = $_POST['message'];
$body = file_get_contents('phpmailer/contents.html');
$body = eregi_replace("[\]",'',$body);
$body = eregi_replace("<name>", $name,$body);
$body = eregi_replace("<telephone>", $telephone, $body);
$body = eregi_replace("<email>", $email, $body);
$body = eregi_replace("<message>", $message, $body);
$mail->IsSMTP(); // telling the class to use SMTP
$mail->Host = "smtp.gmail.com"; // SMTP server
// enables SMTP debug information (for testing)
// 1 = errors and messages
// 2 = messages only
$mail->SMTPAuth = true; // enable SMTP authentication
$mail->SMTPSecure = "ssl"; // sets the prefix to the servier
$mail->Host = "smtp.gmail.com"; // sets GMAIL as the SMTP server
$mail->Port = 465; // set the SMTP port for the GMAIL server
$mail->Username = "[email protected]"; // GMAIL username
$mail->Password = "xxxxx";
$mail->AddReplyTo($email, $name);
$address = "xxxx.net";
$mail->AddAddress($address, "Contact form");
$mail->Subject = " Contact Form";
謝謝布拉德,這節省了我很多時間,認爲你是正確的關於Gmail的回覆。認爲他只需要忍受它。 – Roscoeh 2010-10-22 05:29:16