小编Jos*_*hua的帖子

当我尝试使用 PHP + Swiftmailer 发送电子邮件时出现错误:“501 5.5.4 域名无效”

我正在编写一个非常简单的联系表格,允许蓝领工人通过我们的内联网提交安全问题通知。联系表单以 HTML 格式显示,并要求输入姓名、发件人电子邮件以及要发送的消息。它总是发送到我们的安全电子邮件。

服务器和端口正确。它是一个 Exchange 2010 服务器,我们使用 TSL。服务器配置为能够“匿名”接收电子邮件。我可以通过 telnet 命令进行连接,但当我尝试通过评论框发送邮件时,收到“501 5.5.4 域名无效”错误。

define("EMAIL_SUBJECT", "Safety Concerns");     
    define("EMAIL_TO", "email");        

    // SMTP Configuration
    define("SMTP_SERVER", 'server');                
    define("SMTP_PORT", 25);                                

    // define("UPLOAD_DIR", '/var/www/tmp/');           // Default php upload dir

    // main method. It's the first method called
    function main($contactForm) {

        // Checks if something was sent to the contact form, if not, do nothing
        if (!$contactForm->isDataSent()) {
            return;
        }

        // validates the contact form and initialize the errors
        $contactForm->validate();

        $errors = array();

        // If the contact form …
Run Code Online (Sandbox Code Playgroud)

php email swiftmailer

5
推荐指数
1
解决办法
2万
查看次数

标签 统计

email ×1

php ×1

swiftmailer ×1