There are several reasons why this may fail. The main obstacle to finding the cause is the use of the error management operator (@) before calling the mail () function.
From. $, mail(). , From , . , . mail(), , -f, .
, . mail() SMTP, , .
, , . PHP "\ r\n", "\n\n".
, , :
<?php
$to = 'dannyfeher69@gmail.com';
$subject = 'Test email';
$message = "Hello World!\r\nThis is my mail.";
$header = "From: me@localhost.com";
$mail_sent = mail($to, $subject, $message, $header);
echo $mail_sent ? "Mail sent" : "Mail failed";
?>