1

I'm using JavaMail to send email requests to an SMTP server. I'm setting both "mail.smtp.connectiontimeout" and "mail.smtp.timeout" properties to 5 and 30 seconds respectively and passing both of these to Session.getDefaultInstance(). However, when I go to do the Transport.send(), the timeouts I set appear to be ignored and it's taking around 3:45 to timeout on a Solaris machine. The timeout takes around 1:30 on a Mac. Is this a bug in JavaMail or do I need to set some other properties?

1 Answer 1

1

I think the timeout settings were specific to the Sun JVM - so it may not work on the mac exactly the same.

I have had this issue in the past - eventually consuming up the web threads. What I did was add in a little JMS so the web tier code would dispatch the email request - and have a message listener (which was its own thread) listen and do the email - in the occasional case when it did get stuck it didn't effect the rest of the app (just the emails took a little longer for a small time). Doesn't really solve the root problem but I ended up with a better design.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.