Closed brunorene closed 9 years ago
Hi!
The session is available through SmtpConnectionFactory#getSession
. In my opinion it is more logical to access it using this method than through the builder that is not a reusable component
I have added ClosableSmtpConnection#getSession
and SmtpConnectionPool#getSession
You will be able to do:
try (ClosableSmtpConnection transport = smtpConnectionPool.borrowObject()) {
MimeMessage mimeMessage = new MimeMessage(transport.getSession());
[...]
}
Hi,
When you create a SmtpConnectionFactoryBuilder you can create a inner Session that is not accessible from the outside. So when you want to create a new MimeMessage you can't reuse the Session created inside the Builder. I had to create a SmtpConnectionFactory directly and create the Session outside it in order to create new MimeMessages
Regards