我有一个可以在我的服务器上正常工作的电子邮件脚本,但是当我把它放在另一个服务器上时,我需要将服务器名称从 localhost 更改为他们拥有的名称。我拥有的电子邮件脚本没有服务器名称,我想知道该怎么做?下面是脚本...
<?PHP
$email = $_POST["emailaddress"];
$firstname = $_POST["firstname"];
$lastname = $_POST["lastname"];
$zipcode = $_POST["zipcode"];
$feedback = $_POST["feedback"];
$date=date("d-m-Y");
$to = "";
$subject = "New Feedback Received";
$headers = 'MIME-Version: 1.0' . "\r\n";
$headers .= 'Content-type: text/html; charset=iso-8859-1' . "\r\n";
$headers .= "From: $email\n";
$message = "
<html>
<head></head>
<body>
A visitor to your website has left the following feedback; <br /><br />
Date: $date <br />
First Name: $firstname <br />
Last Name: $lastname <br />
Zip Code: $zipcode <br />
Email Address: $email <br />
Feedback: $feedback <br />
<img src=\"" />
</body>
</html>
";
$user = "$email";
$usersubject = "Thank You";
$userheaders = 'MIME-Version: 1.0' . "\r\n";
$userheaders .= 'Content-type: text/html; charset=iso-8859-1' . "\r\n";
$userheaders .= "From: info@westmorelandberryfarm.com\n";
$usermessage =
"
<html>
<head></head>
<body>
Thank you for your feedback, your comments are important to us.
<br /><br />
We hope to see you at the Farm very soon!
<br /><br />
<br />
Tel: <br />
<a href=\""</a><br />
<img src=\"" />
</body>
</html>
";
mail($to,$subject,$message,$headers);
mail($user,$usersubject,$usermessage,$userheaders);
$fh = fopen("feedback.txt", "a");
fwrite($fh, "Date:$date\r\nFirst Name:$firstname\r\nLast Name:$lastname\r\nEmail:$email\r\nZip Code:$zipcode\r\nFeedback:$feedback\r\n \r\n");
fclose($fh);
?>