Package io.jmix.email
Interface EmailConnectionTester
- All Known Implementing Classes:
EmailConnectionTesterImpl
@NullMarked
public interface EmailConnectionTester
Verifies connectivity and authentication with the configured mail server without sending
anything.
-
Method Summary
Modifier and TypeMethodDescriptionvoidConnects the underlying mail transport, performs authentication and closes the connection.
-
Method Details
-
testConnection
void testConnection() throws jakarta.mail.MessagingExceptionConnects the underlying mail transport, performs authentication and closes the connection. When OAuth2 authentication is enabled, this includes obtaining an access token, so an invalid or revoked refresh token is reported as a failure.- Throws:
jakarta.mail.MessagingException- if the connection or authentication failsIllegalStateException- if the configured mail sender does not support connection testing, or a token cannot be obtained
-