我使用了与教程中相同的代码,但我不知道什么是错误&在我的gmail帐户中没有收到电子邮件。将代码上传到服务器后,我已经检查了
<html>
<head>
</head>
<body>
<?php
$to="rinku.d52@gmail.com_";
$subject="Test mail";
$massage="This email is from Sandeep Kumar";
$headers="From:Sandeep Kumar<sandeep@gmail.com>";
if(mail($to, $subject, $massage, $headers))
{
echo"email Sent";
}
else{
echo"failed";
}
</body>
</html>
答案 0 :(得分:1)
尝试从$ to中删除_吗?
$to="rinku.d52@gmail.com";