Hi, At this moment, I test whether a connection to the smtp server is valid or not, by executing this code: ``` public void testConnection() { try { Mailer mailer = createMailer(); Session session = mailer.getSession(); Transport transport = session.getTransport("smtp"); try { transport.connect(); } finally { transport.close(); } } catch (MessagingException e) { ... handle error ... } } ``` That's why I need access to the Session object: > _"Providing access to Session instance for emergency fall-back scenario. Please let us know why you need it."_ Is there another way to do this without actually sending an email and without using the Session object? Thanks, Best regards, Steven.
Activity
bbottema commentedon Nov 14, 2017
Not yet, but thanks for reporting. I think it's an interesting feature!
#116: provide a connection test based on the current configuration (T…
bbottema commentedon Nov 16, 2017
Implemented for version 5.0.0. Should also work with (authenticated) proxy!
#116: updated documentation and tweaked some alignment issues
stevenvanloon commentedon Nov 17, 2017
Looks good!
bbottema commentedon Dec 26, 2017
Released as 5.0.0.rc1-SNAPSHOT. Add OSS' snapshots repo to find it in Maven.
mrj commentedon Apr 19, 2019
The docs should say that an error causes a MailException to be thrown.
bbottema commentedon Apr 19, 2019
@mrj Indeed, I will update the documentation and Javadoc to indicate this. Thanks!