Class AbstractMailer

java.lang.Object
ch.autumo.commons.mailing.AbstractMailer
All Implemented Interfaces:
Mailer
Direct Known Subclasses:
JakartaMailer, JavaxMailer

public abstract class AbstractMailer extends Object implements Mailer
Abstract mailer class.
  • Field Details

    • DEFAULT_SMTP_PORT

      public static final int DEFAULT_SMTP_PORT
      default SMTP port.
      See Also:
    • auth

      protected boolean auth
      Mail authentication?
    • tlsEnable

      protected boolean tlsEnable
      TLS enabled?
    • sslEnable

      protected boolean sslEnable
      SSL enabled?
    • port

      protected int port
      SMTP Port.
    • host

      protected String host
      SMTP Host.
    • pwEncoded

      protected boolean pwEncoded
      Passwords encoded in mail configuration section ('cfg/app.cfg')?
    • user

      protected String user
      Mail user (email).
    • password

      protected String password
      Mail user password.
    • from

      protected String from
      Mail from (email).
  • Constructor Details

    • AbstractMailer

      protected AbstractMailer()
      Default constructor.
  • Method Details

    • initialize

      protected Properties initialize() throws Exception
      Initialize mail configuration; some are store in the returned properties and some attributes are initialized.
      Returns:
      mail configuration
      Throws:
      Exception - if configuration loading fails
    • mail

      public abstract void mail(String[] to, String subject, String html, String text) throws Exception
      Description copied from interface: Mailer
      Mail. HTML + TXT templates are served.
      Specified by:
      mail in interface Mailer
      Parameters:
      to - email receiver addresses
      subject - subject
      html - HTML contents
      text - text contents
      Throws:
      Exception - when mailing fails
      See Also: