小编Ros*_*oeh的帖子

phpmailer无法添加回复地址

我正在尝试向我的php邮件添加回复地址,它只是从"我"发出并回复我的地址.

我有什么想法我做错了吗?我添加了$ mail-> AddReplyTo.我希望它回复Web表单的发件人.

$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 …
Run Code Online (Sandbox Code Playgroud)

php phpmailer

7
推荐指数
1
解决办法
6080
查看次数

标签 统计

php ×1

phpmailer ×1