【问题标题】:Email not working on Plesk server电子邮件在 Plesk 服务器上不起作用
【发布时间】:2018-06-07 11:13:18
【问题描述】:

我正在使用 Plesk GoDaddy 服务器向用户发送电子邮件。我试过这是一个简单的邮件 PHP 函数来发送电子邮件,但它给了我这个错误。

这是我尝试过的代码。

<?php

    ini_set('error_reporting', E_ALL);
    error_reporting(E_ALL);

    if (isset($_POST)) {
        $name = $_POST['email'];
        $from = "info@site.ir";
        $to = 'si87841@gmail.com';  
        $subject = 'Test Sending';
        $message = 'You got a message from '. $name;
        $headers = array(
            'MIME-Version: 1.0',
            'Content-Type: text/html; charset="UTF-8";',
            'Content-Transfer-Encoding: 7bit',
            'Date: ' . date('r', $_SERVER['REQUEST_TIME']),
            'From: ' . $from,
            'Reply-To: ' . $from,
            'Return-Path: ' . $from
        );
        $mailsent = mail($to, $subject, $message, implode("\n", $headers));

       echo "this is mail sent---> " . $mailsent;
    }
?>

【问题讨论】:

    标签: php email plesk plesk-onyx


    【解决方案1】:

    脚本本身正在运行。你的环境有问题。 验证简单的 PHP 脚本是否正常工作,例如

    <?php
    echo "Test Script";
    ?>
    

    据我了解,您在 Windows 上运行 Plesk。在 IIS > 站点 > 域名 > 错误页面 > 编辑功能设置中启用详细报告

    并检查详细的错误。

    如果信息不够,请检查EventViewer是否有错误,尝试启用failed request tracing via Plesk并检查报告。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2021-09-27
      • 2016-12-07
      • 1970-01-01
      • 2020-07-16
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多