0

我的代码有问题,请让我知道我到底哪里出错了。我正在向我的帐户发送一封电子邮件,我收到的错误是……我只收到了一半的信息。

为了清楚地了解我在问什么,我附上了下面的代码。

<?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>"
?>
4

2 回答 2

0

参考这个链接:- http://www.w3schools.com/php/php_mail.asp,也首先使用这个“var_dump($_POST);” 并检查您是否获得所有值。我认为电子邮件功能在本地主机上不起作用。

于 2012-07-04T14:30:09.043 回答
0

尝试使用 SMTP (http://phpmailer.worxware.com/) 发送

于 2012-07-04T12:14:46.230 回答