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

2019-07-30 15:09发布

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.

标签: php smtp pear
1条回答
狗以群分
2楼-- · 2019-07-30 15:30

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.

查看更多
登录 后发表回答