$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;
}
I have tried this and it is not on localhost.it is not working.is there any way to show what is the error ? is there any need to be change the setting in php.ini?