我已经在我的计算机上为学校项目安装了 xampp,并且我还可以访问学校的 apache 服务器,在那里我可以上传我的文件并运行它们。
<?php
$headers.= 'MIME-Version: 1.0' . "\r\n";
$headers.= 'Content-type: text/html; charset=iso-8859-1' . "\r\n";
$rating=$_POST['Rating'];
$subject= "review from website";
$name=$_POST['lname'].", ".$_POST['name'];
$from = $_POST['email'];
$to ="bricebathel@hotmail.com; bbathel@pembaserv.com;".$from.";";
$messageTo="BBComputers";
$headers = "From:" . $from;
$message = htmlspecialchars($_POST['comment']);
$about = $_POST['product'];
$date=date("j-n-y \a\\t g:ia\n");
mail($to,$subject,$message,$headers);
echo "<p id='contactUsData'>Message Sent to: ".$messageTo."<br>Date: ".$date."<br> From: ".$name."<br> About: ".$about."<br> Rating: ".$rating."<br> Message:".$message."<//p>";
$file_message="From: ".$name."\nEmail: ".$from."\nAbout: ".$subject."\nRating: ".$rating."\nMessage: ".$message;
$file= fopen("data/feedback.txt","a")
or die("Error: Could not open the log file.");
fwrite($file,"\n----------------------------\n")
or die("Error: Could not open the log file.");
fwrite($file,"Received: ".$date."\n")
or die("Error: Could not open the log file.");
fwrite($file,$file_message)
or die("Error: Could not open the log file.");
?>
我无法让它从 xampp 或 apache 服务器发送邮件