0

这是我到目前为止..

 $full_name = $_REQUEST['full_name'] ;         
 $company = $_REQUEST['company'] ;       
 $abn = $_REQUEST['abn'] ;     
 $customer_number = $_REQUEST['customer_number'] ;     
 $about = $_REQUEST['about'] ;     
 $areacode = $_REQUEST['areacode'] ;     
 $telephone = $_REQUEST['telephone'] ;         
 $email = $_REQUEST['email'] ;     
 $message = $_REQUEST['message'] ;     
 $body =" Full Name: ".$full_name."\n

Company: ".$company."\n                 
ABN: ".$abn."\n    
Customer Number: ".$customer_number."\n
About: ".$about."\n       
Area Code: ".$areacode."\n      
Telephone: ".$telephone."\n     
Email: ".$email."\n                     
Message: ".$message;

$to = "$email";

 mail( "info@rentforbusiness.com.au", "Contact Us Form", $body, "From: $email" );
4

2 回答 2

0

就像你为自己做的一样。

mail($email, "Thanks For Resistering", $a_thank_you_message, "From: info@rentforbusiness.com.au" );
于 2012-05-03T02:19:35.247 回答
0

在数据库中创建一个表。它应该包含以下字段:

  • id(自动递增)
  • 电子邮件
  • 信息
  • 确认

当用户发布表单时,不要将邮件发送到您的电子邮件,而是您需要创建随机确认码(例如使用uniqid ):

$confirmation = uniqid();

然后将用户电子邮件、消息文本和确认码添加到表中并向用户发送电子邮件:

$url = "http://".$_POST["SERVER_NAME"].
  "/confirmation.php?confirmation=$confirmation'>";
mail($email, "Confirmation", 
 "Please press the following link to confirm your message: 
 <a href='http://$url'>confirm</a>.");

confirmation.php文件使用$_GET["confirmation"]变量中,在表中搜索匹配的记录,从中获取电子邮件和消息,并将此数据发送到您的电子邮件。如果需要,您可以在它之后从数据库中删除条目。

于 2012-05-03T02:25:50.343 回答