梨邮发很慢(10秒发送) [英] Pear Mail Going Very Slow (10 seconds to send)

查看:148
本文介绍了梨邮发很慢(10秒发送)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

类似的问题已经被问到由别人,但没有答案。

我正在使用Pear Mail发送两封电子邮件,但是当调试为什么我的脚本缓慢时,我发现这是平均10.34秒发送两个电子邮件。

I am sending two emails using Pear Mail, but when debugging why my script was going slow, I discovered it was taking an avg of 10.34 seconds to send both emails.

我没有设置我应该的东西吗?我可以改变什么?

Am I not setting something that I should? Anything I can change?

这是我的代码:

$sendMail = sendMail($to, $subject, $message_body);

function sendMail($to, $subject, $message_body)
{
    $headers["From"] = "<my from address>";
    $headers["To"] = $to;
    $headers["Reply-To"] = "<my reply to>";
    $headers["Subject"] = $subject;
    $headers["Content-type"] = "text/html";
    $params["username"] = "<my username>";
    $params["password"] = "<my password>";
    $params["host"] = "<my host>";

    $mail_object =& Mail::factory("smtp", $params);
    $sent = $mail_object->send($headers["To"], $headers, $message_body);

    if (PEAR::isError($sent)) {
        return "Could Not Send Email Alerts. Please try submitting your request later.";
    }

    return 1;
}


推荐答案

正在对您进行反垃圾邮件检查。这些可能包括反向DNS检查,黑名单检查(即RBL),内容扫描和限制。如果您可以运行网络嗅探器来观看流量,您可能会了解到发生了什么。您可能还需要联系正在连接到的服务器的管理员,并询问正在执行哪些检查以及您可能遵守哪些规则,以避免(或加快其中一些)。

It's likely that the receiving server is performing anti-spam checks on you. These could include reverse DNS checks, blacklist checks (i.e., RBLs), content scanning, and throttling. If you can run a network sniffer to watch the traffic, you might get a clue as to what is happening. You might also want to contact the administrator of the server you're connecting to, and ask what checks are being performed and what rules you might be able to adhere to in order to avoid (or quicken) some of them.

这篇关于梨邮发很慢(10秒发送)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆