PHP邮件未成功发送代码

PHP邮件未成功发送代码,php,sendmail,Php,Sendmail,我正在尝试从联系人表单发送邮件,但不幸的是,我没有收到任何邮件,但我的代码运行成功。它显示邮件已发送,但我尚未收到任何邮件。我不知道是什么问题。有人知道这个解决方案吗??他们是受欢迎的 <?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_head

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

<?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); 

你能分享你的代码片段吗?因此,我们将能够以更好的方式帮助您。尝试不同的电子邮件ID,您的电子邮件代码plz???您能提供您的代码吗???@PaulCrovella我已经看过了。但这没用。我仍然无法获得任何邮件我尝试配置sendmail,但仍然存在相同的问题。