PHP邮件不发码成功

PHP Mail does not send code successful

我正在尝试从联系表单发送邮件,但不幸的是我没有收到任何邮件,但我的代码运行成功。显示邮件已发送,但我没有收到任何邮件。我不知道是什么问题。有谁知道解决办法吗??欢迎他们。

<?php
error_reporting(-1);
ini_set('display_errors', 'On');
set_error_handler("var_dump");

ini_set("mail.log", "/tmp/mail.log");
ini_set("mail.add_x_header", TRUE);
$message = "Line 1\r\nLine 2\r\nLine 3";

$message = wordwrap($message, 70, "\r\n");

if(mail('abc@xyz.com', 'My Subject', $message))
{
echo $message." sent successfully";
}

?>

提前致谢:)

希望对您有所帮助。我也在使用这个代码,试试这个代码:

$email = 'abc@gmail.com';  
$password = '$email';  
$hash = md5(rand(0,1000));
$to = '$email'; 
$subject = 'Registration | Verification'; 
$message = 'Thanks for signing up! Your account has been created, you can login with the following credentials after you have activated your account by pressing the url below.                          
------------------------
    Email: '.$email.'
    Password: '.$password.'
------------------------
Please click this link to activate your account:http://abc.yourdomain.com/register/activate.php?email='.$email.'&hash='.$hash.''; 
$headers = 'From:admin@thedigitalmarketingonline.com' . "\r\n"; 
mail($to, $subject, $message, $headers);