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 Type
    Method
    Description
    void
    Connects the underlying mail transport, performs authentication and closes the connection.
  • Method Details

    • testConnection

      void testConnection() throws jakarta.mail.MessagingException
      Connects 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 fails
      IllegalStateException - if the configured mail sender does not support connection testing, or a token cannot be obtained