Some days ago when using mail()
I had it working.
But now I doesn't work. And I don't know what the problem is.
$to = '[email protected]';
$subject = 'the subject';
$message = 'hello';
$headers = 'From: [email protected]' . "\r\n" .
'Reply-To: [email protected]' . "\r\n" .
'X-Mailer: PHP/' . phpversion();
mail($to, $subject, $message, $headers);
$mail_sent = @mail( $to, $subject, $message, $headers );
echo $mail_sent ? "Mail sent" : "Mail failed";
It displays "Mail sent".
I haven't touched anything in Apache or this code. I have tested the code in an empty PHP file with the same result. How can I debug this problem?