What makes PHP's mail() function so slow?

后端 未结 2 1473
一生所求
一生所求 2020-12-30 09:58

I made a quick PHP script on my server containing a call to mail() and started testing it. The html page always loads instantly, so I assume that means the PHP containing th

2条回答
  •  孤城傲影
    2020-12-30 10:57

    Just as @Michael Berkowski said, it's not the mail() function itself. mail() works by calling your systems built in SMTP courier software. It then automatically negotiates the conversation with the receiving system by performing the necessary DNS lookups to find the proper mail server. Then that server picks up your message, checks your system through grey-listing and reverse DNS lookups, scans it and runs it against it's own spam/virus protection, then finally delivers. Also many mail servers delay unknown sending servers to prevent against mail DOS'ing and fishers.

提交回复
热议问题