【问题标题】:Can not Mail. php mail() showing warning不能邮寄。 php mail() 显示警告
【发布时间】:2016-06-14 07:37:27
【问题描述】:

警告:邮件(/home/u295560656/.logs/php_mail.log):无法打开流:第 9 行的 /home/u295560656/public_html/2.php 中没有此类文件或目录 已发送测试电子邮件

这个错误是怎么回事?以前我可以发送邮件,但现在不能使用 Hostinger 托管服务。

这是我的代码:

<?php 
    ini_set( 'display_errors', 1 );
    error_reporting( E_ALL );
    $from = "smthing@gmail.com";
    $to = "smthing_else@gmail.com";
    $subject = "PHP Mail Test script";
    $message = "This is a test to check the PHP Mail functionality";
    $headers = "From:" . $from;
    mail($to,$subject,$message, $headers);
    echo "Test email sent";
?>

【问题讨论】:

    标签: php email warnings phpmailer


    【解决方案1】:

    实际上您已更改为 Hostinger 托管服务。但之前您使用了不同的托管服务。 我认为您将日志文件的路径定义为静态值。 所以请将日志文件的路径更改为当前托管服务。

    否则使用以下语句关闭警告

    error_reporting(0); 将第 3 行替换为上述语句。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2011-02-01
      • 2011-11-30
      • 1970-01-01
      • 1970-01-01
      • 2014-05-16
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多