Interface MailManager

All Superinterfaces:
MailConfigurationService
All Known Implementing Classes:
MailManagerImpl

public interface MailManager extends MailConfigurationService
  • Method Details

    • sendHtmlEmail

      @Deprecated void sendHtmlEmail(javax.mail.internet.InternetAddress emailAddress, String subject, String body, String plainText) throws MailSendException
      Deprecated.
      Sends an HTML email using the configured mail server (remote host / JNDI).
      Parameters:
      emailAddress - address of recipient.
      subject - subject header. Will be appended with the configured mail subject prefix in the final email.
      body - email body html.
      plainText - plainText alternative to the html body text specified in body
      Throws:
      MailSendException - an error occurred sending the email.
    • sendPlainTextEmail

      @Deprecated void sendPlainTextEmail(javax.mail.internet.InternetAddress emailAddress, String subject, String body) throws MailSendException
      Deprecated.
      Sends an email using the configured mail server (remote host / JNDI).
      Parameters:
      emailAddress - address of recipient.
      subject - subject header. Will be appended with the configured mail subject prefix in the final email.
      body - email body text.
      Throws:
      MailSendException - an error occurred sending the email.
    • sendPlainTextEmail

      @Deprecated void sendPlainTextEmail(javax.mail.internet.InternetAddress emailAddress, String subject, String body, Map<String,String> headers, Map<String,javax.activation.DataSource> attachments) throws MailSendException
      Deprecated.
      Sends an email with zero or more attachments and headers using the configured mail server (remote host / JNDI).
      Parameters:
      emailAddress - address of recipient.
      subject - subject header. Will be appended with the configured mail subject prefix in the final email.
      body - email body text.
      headers - custom headers to add.
      attachments - [displayed filename]->[data] mapping for attachments.
      Throws:
      MailSendException - an error occurred sending the email.
      Since:
      2.11
    • sendTestMail

      SendTestMailResult sendTestMail(SMTPServer smtpServer, javax.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<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
    • saveConfiguration

      @Deprecated void saveConfiguration(MailConfiguration mailServerEntity)
      Deprecated.
      Sets the new mail configuration
      Specified by:
      saveConfiguration in interface MailConfigurationService
      Parameters:
      mailServerEntity - new configuration
      Since:
      3.2
    • getMailConfiguration

      @Deprecated MailConfiguration getMailConfiguration()
      Deprecated.
      Returns current mail configuration
      Specified by:
      getMailConfiguration in interface MailConfigurationService
      Returns:
      Mail configuration
      Throws:
      PropertyManagerException - property does no exist
      Since:
      3.2
    • isConfigured

      @Deprecated boolean isConfigured()
      Deprecated.
      Specified by:
      isConfigured in interface MailConfigurationService
      Returns:
      true if the mail server is fully configured (does not check if the configuration is correct)