0

我在网站上使用简单的联系表格和脚本。我唯一的问题是,当我收到他们的提交时,我希望填写表格的人的电子邮件用作电子邮件地址的回复,而不是我的服务器地址。这样我就可以简单地回复联系人,而不必复制和粘贴他们的地址并开始新的电子邮件回复。

有什么简单的方法可以做到这一点吗?

下面是我正在使用的简单代码。

<?php
header('Location: http://XXXXXXXXXXXXXXXXX/contact.html'); 

$name = $_REQUEST['Person'];  
$company = $_REQUEST['company'];
$address = $_REQUEST['address'];
$city = $_REQUEST['city'];
$state = $_REQUEST['state'];
$zip = $_REQUEST['zip'];
$email = $_REQUEST['email'];
$phone = $_REQUEST['phone'];
$subject = $_REQUEST['subject'];
$details = $_REQUEST ['details'];
$byphone = $_REQUEST ['Phonebox'];
$emailbox = $_REQUEST['Emailbox'];
$message = "From  $name\n Company $company\n Address $address\n $city $state $zip\n Email  $email\n Phone $phone\n Subject $subject\n\n Details $details\n\n Contact by $byphone $emailbox";

mail ("XXXXXXXXX.com", "Customer Inquiry", "$message", "$email");
?>
4

1 回答 1

0

看看这个: http: //php.net/manual/en/function.mail.php

(以下示例)

<?php
$to      = 'server_owner@example.com';
$subject = 'the subject';
$message = 'hello';
$headers = 'From: i_filled_the_form@example.com' . "\r\n" .
    'Reply-To: i_filled_the_form@example.com' . "\r\n" .
    'X-Mailer: PHP/' . phpversion();

mail($to, $subject, $message, $headers);
?>
于 2012-06-25T00:48:10.147 回答