php mail()无法使用服务器

时间:2018-05-03 12:29:46

标签: php

<?php

ini_set('display_errors', '1');
include '../application/includes/config.php';


$mailto=$_POST['email'];
$subject="Information";
$message_body="Welcome to the digital world!";
$from="info@mydomain.com";


$mail = mail($mailto,$subject,$message_body,"From:".$from);

if($mail){
  echo "Thank you for using our mail form";
}else{
  echo "Mail sending failed."; 
}
?>

我已在其他网站上测试过此代码。它在那里工作,但在我的服务器上它只显示“邮件发送失败”错误..

0 个答案:

没有答案