views:

187

answers:

1

Hi,

I was wondering if anyone might be able to explain to me why it's taking nearly 30 seconds each time my Java web app sends an email using Gmail's SMTP server? See the following timestamps:

13/04/2010-22:24:27:281 DEBUG test.service.impl.SynchronousEmailService - Before sending mail. 13/04/2010-22:24:52:625 DEBUG test.service.impl.SynchronousEmailService - After sending mail.

I'm using spring's JavaMailSender class with the following settings:

email.host=smtp.gmail.com

[email protected] email.password=mypassword email.port=465 mail.smtp.auth.required=true

Note that the mail is getting sent and I'm receiving it fine, there's just this delay which is resulting in a slow experience for the application user.

If you know how I can diagnose the problem myself that would be good too :)

A: 

I have the same problem. Thinking about using a thread to send the email (making email sending non-blocking), although this does suck if it fails, because currently the transaction is nicely rolled back if the mailing fails and the user sees an error.

virgo_ct