$to = 'others@gmail.com';
$subject = 'the subject';
$message = 'hello';
$from = "my@gmail.com";
$headers = "From:" . $from;
mail($to, $subject, $message,$headers);
if(mail($to, $subject, $message,$headers))
echo 1;
else{
echo 2;
}
我试过这个并且它不在localhost.it不工作。有什么方法可以显示错误是什么?是否需要更改php.ini中的设置?