回复来自的电子邮件地址

时间:2012-05-16 18:22:56

标签: php webforms

这是process.php。我想从表格上的电子邮件地址收到电子邮件,以便我回复

<?php

$where_form_is="http://".$_SERVER['SERVER_NAME'].strrev(strstr(strrev($_SERVER['PHP_SELF']),"/"));

 // To send HTML mail, the Content-type header must be set
    $headers = "MIME-Version: 1.0\n";
    $headers .= "Content-Type: text/html; charset=ISO-8859-1\n";
    $headers .= "From: " .  $_POST['field_9'] . "\n"; 
    $headers .= "Reply-To: ". $_POST['field_9'] . "\n";

mail("harshad@madiganpratt.com","Reservaion Enquiry","Form data:


Preferred Arrival Date : " . $_POST['field_1'] . " 
Preferred Departure Date: " . $_POST['field_2'] . " 
Room Category: " . $_POST['field_3'] . " 
Adults: " . $_POST['field_4'] . " 
Children: " . $_POST['field_5'] . " 
Please contact me by: " . $_POST['field_6'] . " 
First Name: " . $_POST['field_7'] . " 
Last Name: " . $_POST['field_8'] . " 
Email: " . $_POST['field_9'] . " 
Phone: " . $_POST['field_10'] . " 

");

include("confirm.html");

?>

...

1 个答案:

答案 0 :(得分:0)

您需要设置标题:

            // To send HTML mail, the Content-type header must be set
        $headers = "MIME-Version: 1.0\n";
        $headers .= "Content-Type: text/html; charset=ISO-8859-1\n";
        $headers .= "From: " .  $from . "\n"; 
        $headers .= "Reply-To: ". $from . "\n";
        $headers .= "CC: email@eami.com\n"; 

        // Mail it
        mail($to, $subject, $message, $headers);