我在我的計算機上安裝了xampp用於學校項目,並且我也可以訪問學校中的apache服務器,我可以上傳我的文件並運行它們。我無法通過xampp或遠程服務器發送帶有我的php郵件功能的電子郵件
<?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 ="[email protected]; [email protected];".$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服務器