代码如下所示
<?php
$to = "mymail@gmail.com";
$subject = "My subject";
$txt = "Hello world!";
$headers = "From: webmaster@example.com" . "\r\n" .
"CC: somebodyelse@example.com";
if(mail($to,$subject,$txt,$headers))
{
echo "success";
}
else{
echo "failure";
}
?>
此代码在我的服务器中运行良好,但它移动到GoDaddy服务器,它显示成功消息,但我没有收到邮件。