我有一个发送电子邮件的脚本,在我的VPS上的一个域名上可以正常工作,但在另一个域名上却无法工作,这非常令人困惑!我检查了所有smtp详细信息等等,但找不到任何原因。脚本运行时似乎是成功的,没有出现错误,并且变量都已就位。
如果有人有任何想法,将不胜感激!
<?php
$email=$_POST['email'];
$name=$_POST['name'];
$business=$_POST['business'];
$town=$_POST['town'];
$phone=$_POST['phone'];
$rpo=str_replace("rpo", "RPO",$_POST['rpo']);
$retained=str_replace("retained", "Retained",$_POST['retained']);
$ats=str_replace("ats", "ATS",$_POST['ats']);
$interest=$rpo . ' ' . $retained . ' ' . $ats;
$interest=str_replace('','<br>',$interest);
$msg = "You've received a new enquiry from $name at $business<br>
They are based in $town and interested in:<br>
$interest<br>
You can contact them on:<br>
<b>Phone: </b>$phone<br>
<b>Email: </b>$email<br>
This is an automatically generated email from the company website generated from http://example.com";
$msg = wordwrap($msg,70);
mail('example@example.com','New Enquiry',$msg);
header("location:http://example.com");
?>
if(mail('example@example.com','新查询',$msg))
来确保邮件功能正常工作。 - undefined