Using Gmail as an SMTP server in Java Web applications is slow

I wonder if anyone can explain to me why every time my java web application uses Gmail's SMTP server to send e-mail, it takes nearly 30 seconds? See the following timestamp:

13/04 / 2010-22:24:27:281 DEBUG test. service. impl. Synchronous emailservice – before sending a message 13/04 / 2010-22:24:52:625 DEBUG test. service. impl. Synchronous emailservice – after sending a message

I am using spring's javamailsender class, which contains the following settings:

email. host = smtp. gmail. com

email. username= myaccount@gmail.com email. Password = enter mypassword email port = 465 mail. smtp. auth. Required = true

Please note that the mail is being sent and I received it well. Only this delay leads to a slow application user experience

If you know how I can diagnose this problem myself, it's also good:)

Solution

It is possible that Gmail uses this delay to prevent spammers from using their SMTP server "externally": this delay will not be used if SMTP is called from an actual webmail client To test this, you can open a telnet session to port 25 and perform a manual SMTP session (an example of searching the Internet for SMTP helo)

The content of this article comes from the network collection of netizens. It is used as a learning reference. The copyright belongs to the original author.
THE END
分享
二维码
< <上一篇
下一篇>>