Interface MailManager

All Superinterfaces:
MailConfigurationService

public interface MailManager extends MailConfigurationService
  • Method Details

    • sendTestMail

      SendTestMailResult sendTestMail(com.atlassian.crowd.util.mail.SMTPServer smtpServer, jakarta.mail.internet.InternetAddress emailAddress) throws MailSendException
      Send a test email using the supplied mail server (remote host / JNDI)
      Parameters:
      smtpServer - supplied SMTP Server, which will be used to send message.
      emailAddress - address of recipient.
      Returns:
      result of test, which contains logs and status.
      Throws:
      MailSendException - an error occurred sending the email.
      Since:
      3.2
    • sendEmails

      Collection<? extends EmailMessage> sendEmails(Collection<? extends EmailMessage> messagesToSend) throws MailSendException
      Sends multiple emails using the configured mail server.
      Returns:
      a collection of messages that failed to be sent
      Throws:
      MailSendException - an error occurred that prevented sending any email (connection error, configuration error, etc.).
      Since:
      3.3
    • sendEmail

      void sendEmail(EmailMessage messageToSend) throws MailSendException
      Sends a single email using the configured mail server
      Parameters:
      messageToSend - single email using the configured mail server
      Throws:
      MailSendException - an error occurred sending the email.
      Since:
      4.4.0
    • validateConfiguration

      List<com.atlassian.crowd.validator.ValidationError> validateConfiguration(MailConfiguration mailConfiguration)
      Verifies whether the specified MailConfiguration is valid
      Parameters:
      mailConfiguration - entity with attributes to be validated
      Returns:
      a list with errors found in the configuration
      Since:
      3.2
    • testConnection

      default List<com.atlassian.crowd.validator.ValidationError> testConnection(MailConfiguration mailConfiguration)
      Tests connection for the specified mail configuration. The mail configuration must be validated beforehand.
      Parameters:
      mailConfiguration - entity with attributes to be validated
      Returns:
      a list with errors found in the configuration
      Since:
      7.0.2, 7.1.1