Interface AMSendMail


public interface AMSendMail
Interface for classes which send emails.
  • Method Details

    • postMail

      void postMail(String[] recipients, String subject, String message, String from, String charset) throws javax.mail.MessagingException
      Posts e-mail messages to users. This method will wait on for the timeouts when the specified host is down. Use this method in a separate thread so that it will not hang when the mail server is down.
      Parameters:
      recipients - A String array of e-mail addresses to be sent to
      subject - The e-mail subject
      message - The content contained in the e-mail
      from - The sending e-mail address
      charset - The charset used in e-mail encoding
      Throws:
      javax.mail.MessagingException - if there is any error in sending e-mail
    • postMail

      void postMail(String[] recipients, String subject, String message, String from) throws javax.mail.MessagingException
      Posts e-mail messages to users. This method will wait on for the timeouts when the specified host is down. Use this method in a separate thread so that it will not hang when the mail server is down.
      Parameters:
      recipients - A String array of e-mail addresses to be sent to
      subject - The e-mail subject
      message - The content contained in the e-mail
      from - The sending e-mail address
      Throws:
      javax.mail.MessagingException - if there is any error in sending e-mail
    • postMail

      void postMail(String[] recipients, String subject, String message, String from, String mimeType, String charset) throws javax.mail.MessagingException
      Posts e-mail messages to users. This method will wait on for the timeouts when the specified host is down. Use this method in a separate thread so that it will not hang when the mail server is down.
      Parameters:
      recipients - A String array of e-mail addresses to be sent to
      subject - The e-mail subject
      message - The content contained in the e-mail
      from - The sending e-mail address
      mimeType - The MIME type of the e-mail
      charset - The charset used in e-mail encoding
      Throws:
      javax.mail.MessagingException - if there is any error in sending e-mail
    • postMail

      void postMail(String[] recipients, String subject, String message, String from, String charset, String host, String port, String user, String password, boolean ssl) throws javax.mail.MessagingException
      Posts e-mail messages to users. This method will wait on for the timeouts when the specified host is down. Use this method in a separate thread so that it will not hang when the mail server is down.
      Parameters:
      recipients - A String array of e-mail addresses to be sent to
      subject - The e-mail subject
      message - The content contained in the e-mail
      from - The sending e-mail address
      charset - The charset used in e-mail encoding
      host - The host name to connect to send e-mail
      port - The host port to connect to send e-mail
      user - The user name used to authenticate to the host
      password - The user password used to authenticate to the host
      ssl - A boolean to indicate whether SSL is needed to connect to the host
      Throws:
      javax.mail.MessagingException - if there is any error in sending e-mail
    • postMail

      void postMail(String[] recipients, String subject, String message, String from, String charset, String host, String port, String user, String password, boolean ssl, boolean startTls) throws javax.mail.MessagingException
      Posts e-mail messages to users. This method will wait on for the timeouts when the specified host is down. Use this method in a separate thread so that it will not hang when the mail server is down.
      Parameters:
      recipients - A String array of e-mail addresses to be sent to
      subject - The e-mail subject
      message - The content contained in the e-mail
      from - The sending e-mail address
      charset - The charset used in e-mail encoding
      host - The host name to connect to send e-mail
      port - The host port to connect to send e-mail
      user - The user name used to authenticate to the host
      password - The user password used to authenticate to the host
      ssl - A boolean to indicate whether SSL is needed to connect to the host
      startTls - A boolean to indicate whether Start SSL needs to be enabled
      Throws:
      javax.mail.MessagingException - if there is any error in sending e-mail
    • postMail

      void postMail(String[] recipients, String subject, String message, String from, String mimeType, String charset, String host, String port, String user, String password, boolean ssl) throws javax.mail.MessagingException
      Posts e-mail messages to users. This method will wait on for the timeouts when the specified host is down. Use this method in a separate thread so that it will not hang when the mail server is down.
      Parameters:
      recipients - A String array of e-mail addresses to be sent to
      subject - The e-mail subject
      message - The content contained in the e-mail
      from - The sending e-mail address
      mimeType - The MIME type of the e-mail
      charset - The charset used in e-mail encoding
      host - The host name to connect to send e-mail
      port - The host port to connect to send e-mail
      user - The user name used to authenticate to the host
      password - The user password used to authenticate to the host
      ssl - A boolean to indicate whether SSL is needed to connect to the host
      Throws:
      javax.mail.MessagingException - if there is any error in sending e-mail
    • postMail

      void postMail(String[] recipients, String subject, String message, String from, String mimeType, String charset, String host, String port, String user, String password, boolean ssl, boolean startTls) throws javax.mail.MessagingException
      Posts e-mail messages to users. This method will wait on for the timeouts when the specified host is down. Use this method in a separate thread so that it will not hang when the mail server is down.
      Parameters:
      recipients - A String array of e-mail addresses to be sent to
      subject - The e-mail subject
      message - The content contained in the e-mail
      from - The sending e-mail address
      mimeType - The MIME type of the e-mail
      charset - The charset used in e-mail encoding
      host - The host name to connect to send e-mail
      port - The host port to connect to send e-mail
      user - The user name used to authenticate to the host
      password - The user password used to authenticate to the host
      ssl - A boolean to indicate whether SSL is needed to connect to the host
      startTls - A boolean to indicate whether Start SSL needs to be enabled
      Throws:
      javax.mail.MessagingException - if there is any error in sending e-mail
    • getMimeMessage

      javax.mail.internet.MimeMessage getMimeMessage(String subject, String message, String from, String mimeType, String charset, javax.mail.Session session, String... recipients) throws javax.mail.MessagingException
      Create a MimeMessage representing an email with the input values.
      Parameters:
      subject - the email subject
      message - the contents of the email
      from - the email from address
      mimeType - the email mimetype
      charset - the character set to use for the email subject and message
      session - the session
      recipients - the addresses of the recipients of the email
      Returns:
      a MimeMessage object
      Throws:
      javax.mail.MessagingException - if there's a problem creating the email object