开发者

PEAR Mail is so slow, my front end is timing out

开发者 https://www.devze.com 2023-01-11 20:14 出处:网络
I\'ve got a php script that sends a few emails and echoes a response back to my front end. The problem is that the email handling is so slow, the front end is timing out. Here are the broad strokes f

I've got a php script that sends a few emails and echoes a response back to my front end.

The problem is that the email handling is so slow, the front end is timing out. Here are the broad strokes for the email开发者_开发问答 implementation.

The scenario kicks off when User A books an offer from User B. User A gets a confirmation email, User B gets a notification email and myself and 2 other employees get an email alert.

So that's 3 unique email messages and 5 addresses. And the tech specifics are:

  1. I'm using the Pear Mail class
  2. I'm using smtp as the mail type.
  3. I have authentication set to true.

I thought that the smtp transaction would be pretty straightforward. I assumed I'd handshake with the mail server, pass my message off into their queue and be free and clear. But it does seem that everything is hanging for quite a bit.


The Pear Mail Class is straightforward.

If you are using the host parameter as a URL (like domain.com) instead of an IP address the problem can rely on the DNS timeout, try using IP as the domain for the host (like $smtpinfo["host"] = "200.203.201.123";) instead.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号