Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make sure Transport is closed after sending #25

Closed
zimmi opened this issue Jan 13, 2016 · 4 comments
Closed

Make sure Transport is closed after sending #25

zimmi opened this issue Jan 13, 2016 · 4 comments

Comments

@zimmi
Copy link

zimmi commented Jan 13, 2016

In Mailer::sendMail the Transport could be left open when an error occurs during sending.
It might be better to use a try-finally block like in this example in the official FAQs.

@zimmi
Copy link
Author

zimmi commented Jan 13, 2016

Since JavaMail 1.5 there also seem to be new static Transport::send methods that do the proper cleanup for you. But that might break backward compatibility for users of this library with older JavaMail versions.

@bbottema
Copy link
Owner

The simple-java-mail is mature enough by now that I don't see any critical bug fixes coming very soon for older versions, so I'm probably going to go ahead and use the newer mail API for the next simple-java-mail installment.

@bbottema
Copy link
Owner

@zimmi

Released in v2.5.1.

Added a finally clause.

@zimmi
Copy link
Author

zimmi commented Jan 19, 2016

It's java-simple-mail after all. Thanks! :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants