我的代码有问题,请让我知道我哪里出错了。我正在向我的帐户发送一封电子邮件,我收到的错误是......我只收到了一半的信息。
为了清楚地知道我在问什么,我附上下面的代码。
<?php
$first_name = $_POST["name_t"] ;
$last_name = $_POST["lname_t"] ;
$contact=$_POST["contact"] ;
$email = $_POST["email"] ;
$adults =$_POST["no_adults_t"] ;
$children = $_POST["no_children"] ;
$address = $_POST["address"] ;
$date = $_POST["date_t"] ;
$message = "First Name : ".$first_name."\n\nLast Name : ".$last_name."\n\nContact Number : ".$contact."\n\nAddress :".$address."\n\nE mail :".$email."\n\n Number Of Adults : ".$adults."\n\nNumber Of children : ".$children."\n\nReservation Date : ".$date;
$headers = "From:" . $email;
@mail( "someone@someone.com", "some subject ",$message,$headers);
echo "<pre>".print_r($_REQUEST, 1)."</pre>";
print $first_name;
print $last_name;
print $contact;
print $email;
print $adults;
print $children;
print $address;
print $date;
print "<body style="."background-color:gray"."></body>
<h2 style="."color:maroon;".">Thank You.Your information has been submitted.Our Representative would be contacting you shortly</h2>
<h4 style="."color:blue"."><a href="."index.html".">Click Here To Go Back to Main Page.</a></h4>"
?>
答案 0 :(得分:0)
尝试使用SMTP发送(http://phpmailer.worxware.com/)
答案 1 :(得分:0)
请参阅此链接: - http://www.w3schools.com/php/php_mail.asp, 首先使用这个“var_dump($ _ POST);”并检查您是否获得所有值。我认为电子邮件功能不适用于localhost。