Interface MailServices

All Known Implementing Classes:
ServerChannel

public interface MailServices
Services for sending e-mail messages.
 
Property Description Type Default
mail.«name».connect.timeout Maximum time to wait for a connection (milliseconds) Integer infinite
mail.«name».host Host name or address of the SMTP mail server String required
mail.«name».io.timeout Maximum time to wait for an I/O operation (milliseconds) Integer infinite
mail.«name».password User password to use when connecting to mail servers String required
mail.«name».port Port number of the SMTP mail server Integer 25
mail.«name».recipient Recipient mail address where messages are sent String required
mail.«name».socketFactory.class Name of a class that extends javax.net.SocketFactory String none
mail.«name».socketFactory.fallback Use java.net.Socket if specified socket factory creation fails Boolean true
mail.«name».socketFactory.port Port to connect to when using the specified socket factory Integer default
mail.«name».starttls.enable If true, enables the use of the STARTTLS command Boolean false
mail.«name».use.auth If true, attempt to authenticate using the AUTH command Boolean false
mail.«name».use.ssl If true, use SMTPS protocol (SMTP over SSL) Boolean false
mail.«name».user User name to use when connecting to mail servers String required
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    sendMail(String subject, String text)
    Sends a mail message using the "default" SMTP mail session.
    void
    sendMail(String sessionName, String subject, String text)
    Sends a mail message using the specified SMTP mail session.
  • Method Details

    • sendMail

      void sendMail(String subject, String text) throws Exception
      Sends a mail message using the "default" SMTP mail session.

      This convenience method produces the same result as the following invocation:

      sendMail("default", subject, text);
      Parameters:
      subject - the subject of the mail message.
      text - the text of the mail message.
      Throws:
      NullPointerException - if an argument is null.
      Exception - if another error occurs.
    • sendMail

      void sendMail(String sessionName, String subject, String text) throws Exception
      Sends a mail message using the specified SMTP mail session.
      Parameters:
      sessionName - the name of the mail session.
      subject - the subject of the mail message.
      text - the text of the mail message.
      Throws:
      NullPointerException - if an argument is null.
      Exception - if another error occurs.