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

|▌冷眼眸甩不掉的悲伤 提交于 2020-02-05 10:18:51

问题


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.


回答1:


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.



来源:https://stackoverflow.com/questions/3507917/pear-mail-is-so-slow-my-front-end-is-timing-out

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!