com.ibm.openpages.api.application

## Class EmailOptions

- java.lang.Object
- - com.ibm.openpages.api.application.EmailOptions

-     public class EmailOptions
      extends java.lang.Object

  The class includes information that is used to send email. There are 2 ways to set email subject and body:
  1. set subject and body in email options directly.
  2. set subjectTextKey, subjectParams, bodyKey, bodyParams, linkBuffer, locale, and context.

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `EmailOptions()`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `java.lang.String` | `getBody()` Gets the body of the email
    `java.lang.Object[]` | `getBodyParams()` Gets parameters that will be formated into body text
    `java.lang.String` | `getBodyTextKey()` Gets the key that is used to locate the application string for body
    `Context` | `getContext()` Gets the API context
    `java.lang.String` | `getFrom()` Gets the from email address
    `boolean` | `getIgnoreError()` Gets whether to continue sending out emails when an error occurred
    `java.lang.StringBuffer` | `getLinkBuffer()` Gets the string buffer for a URL that points to the object in OpenPages
    `java.util.Locale` | `getLocale()` Gets the locale to get translated application texts for subject and body
    `java.lang.String` | `getPassword()` Gets the password for authenticating into the SMTP server.
    `java.lang.String` | `getPort()` Gets the port number that identifies the SMTP server port.
    `java.lang.String` | `getRecipients()` Gets the recipients email addresses
    `int` | `getRetryTimes()` Gets the retry times to send email.
    `java.lang.String` | `getSecureType()` Gets the security type of the SMTP server.
    `java.lang.String` | `getSmtpServer()` Gets the SMTP server host or IP address.
    `java.lang.String` | `getSubject()` Gets the subject of the email
    `java.lang.Object[]` | `getSubjectParams()` Gets parameters that will be formated into subject text
    `java.lang.String` | `getSubjectTextKey()` Gets the key that is used to locate the application string for a subject
    `int` | `getTimeout()` Gets the time out (in seconds) to send email.
    `java.lang.String` | `getUsername()` Gets the user name for authenticating into the SMTP server.
    `void` | `setBody(java.lang.String body)` Sets the body of the email
    `void` | `setBodyParams(java.lang.Object[] bodyParams)` Sets parameters that will be formated into body text
    `void` | `setBodyTextKey(java.lang.String bodyTextKey)` Sets the key that is used to locate the application string for body
    `void` | `setContext(Context context)` Sets the API context
    `void` | `setFrom(java.lang.String from)` Sets the from email address.
    `void` | `setIgnoreError(boolean ignoreError)` Sets whether to continue sending out emails when an error occurred
    `void` | `setLinkBuffer(java.lang.StringBuffer linkBuffer)` Sets the string buffer for a URL that points to the object in OpenPages
    `void` | `setLocale(java.util.Locale locale)` Sets the locale to get translated application texts for subject and body
    `void` | `setPassword(java.lang.String password)` Sets the password for authenticating into the SMTP server.
    `void` | `setPort(java.lang.String port)` Sets the port number that identifies the SMTP server port.
    `void` | `setRecipients(java.lang.String recipients)` Sets the recipients email addresses.
    `void` | `setRetryTimes(int retryTimes)` Sets the retry times to send email.
    `void` | `setSecureType(java.lang.String secureType)` Sets the security type of the SMTP server.
    `void` | `setSmtpServer(java.lang.String smtpServer)` Sets the SMTP server host or IP address.
    `void` | `setSubject(java.lang.String subject)` Sets the subject of the email
    `void` | `setSubjectParams(java.lang.Object[] subjectParams)` Sets parameters that will be formated into subject text
    `void` | `setSubjectTextKey(java.lang.String subjectTextKey)` Sets the key that is used to locate the application string for a subject
    `void` | `setTimeout(int timeout)` Sets the time out (in seconds) to send email.
    `void` | `setUsername(java.lang.String username)` Sets the user name for authenticating into the SMTP server.

    - ### Methods inherited from class java.lang.Object

      `equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### EmailOptions

          public EmailOptions()

  - ### Method Detail

    - #### getFrom

          public java.lang.String getFrom()

      Gets the from email address
      Returns:
        the from email address

    - #### setFrom

          public void setFrom(java.lang.String from)

      Sets the from email address. Required.
      Parameters:
        `from` - the from email address

    - #### getRecipients

          public java.lang.String getRecipients()

      Gets the recipients email addresses
      Returns:
        the recipients email addresses

    - #### setRecipients

          public void setRecipients(java.lang.String recipients)

      Sets the recipients email addresses. Required.
      Parameters:
        `recipients` - the recipients email addresses. Could be a comma-separated string of multiple recipients.

    - #### getSubjectTextKey

          public java.lang.String getSubjectTextKey()

      Gets the key that is used to locate the application string for a subject
      Returns:
        The key that is used to locate the application string for a subject

    - #### setSubjectTextKey

          public void setSubjectTextKey(java.lang.String subjectTextKey)

      Sets the key that is used to locate the application string for a subject
      Parameters:
        `subjectTextKey` - the key is that used to locate the application string for a subject

    - #### getSubjectParams

          public java.lang.Object[] getSubjectParams()

      Gets parameters that will be formated into subject text
      Returns:
        Parameters that will be formated into subject text

    - #### setSubjectParams

          public void setSubjectParams(java.lang.Object[] subjectParams)

      Sets parameters that will be formated into subject text
      Parameters:
        `subjectParams` - parameters that will be formated into subject text.

    - #### getBodyTextKey

          public java.lang.String getBodyTextKey()

      Gets the key that is used to locate the application string for body
      Returns:
        The key that is used to locate the application string for body

    - #### setBodyTextKey

          public void setBodyTextKey(java.lang.String bodyTextKey)

      Sets the key that is used to locate the application string for body
      Parameters:
        `bodyKey` - the key that is used to locate the application string for body

    - #### getBodyParams

          public java.lang.Object[] getBodyParams()

      Gets parameters that will be formated into body text
      Returns:
        parameters that will be formated into body text

    - #### setBodyParams

          public void setBodyParams(java.lang.Object[] bodyParams)

      Sets parameters that will be formated into body text
      Parameters:
        `bodyParams` - parameters that will be formated into body text

    - #### getSubject

          public java.lang.String getSubject()

      Gets the subject of the email
      Returns:
        the subject of the email

    - #### setSubject

          public void setSubject(java.lang.String subject)

      Sets the subject of the email
      Parameters:
        `subject` - the subject of the email

    - #### getBody

          public java.lang.String getBody()

      Gets the body of the email
      Returns:
        the body of the email

    - #### setBody

          public void setBody(java.lang.String body)

      Sets the body of the email
      Parameters:
        `body` - the body of the email

    - #### getIgnoreError

          public boolean getIgnoreError()

      Gets whether to continue sending out emails when an error occurred
      Returns:
        whether to continue sending out emails when an error occurred

    - #### setIgnoreError

          public void setIgnoreError(boolean ignoreError)

      Sets whether to continue sending out emails when an error occurred
      Parameters:
        `ignoreError` - whether to continue sending out emails when an error occurred

    - #### getContext

          public Context getContext()

      Gets the API context
      Returns:
        the API context

    - #### setContext

          public void setContext(Context context)

      Sets the API context
      Parameters:
        `context` - the API context

    - #### getLinkBuffer

          public java.lang.StringBuffer getLinkBuffer()

      Gets the string buffer for a URL that points to the object in OpenPages
      Returns:
        the string buffer for a URL that points to the object in OpenPages

    - #### setLinkBuffer

          public void setLinkBuffer(java.lang.StringBuffer linkBuffer)

      Sets the string buffer for a URL that points to the object in OpenPages
      Parameters:
        `linkBuffer` - the string buffer for a URL that points to the object in OpenPages

    - #### getLocale

          public java.util.Locale getLocale()

      Gets the locale to get translated application texts for subject and body
      Returns:
        the locale to get translated application texts for subject and body

    - #### setLocale

          public void setLocale(java.util.Locale locale)

      Sets the locale to get translated application texts for subject and body
      Parameters:
        `locale` - the locale to get translated application texts for subject and body

    - #### getSmtpServer

          public java.lang.String getSmtpServer()

      Gets the SMTP server host or IP address. As described on `setSmtpServer(String)`, this function may return null, which means the system will look up the registry setting.
      Returns:

    - #### setSmtpServer

          public void setSmtpServer(java.lang.String smtpServer)

      Sets the SMTP server host or IP address. You can leave it null to look up the registry setting ( "/OpenPages/Applications/Common/Email/Mail Server" )
      Parameters:
        `smtpServer` -

    - #### getSecureType

          public java.lang.String getSecureType()

      Gets the security type of the SMTP server. Refer `setSecureType(String)` for the available values.
      Returns:
        the security type of the SMTP server

    - #### setSecureType

          public void setSecureType(java.lang.String secureType)

      Sets the security type of the SMTP server. Available values are: "SSL" for SSL/TLS encryption connecting to port 465 by default "TLS" for opportunistic TLS ( STARTTLS ) communication connecting to port 587 by default "plain" for plain text communication with port 25 by default Or leave it null to look it up from registry setting ( "/OpenPages/Applications/Common/Email/SMTP Security Type" )
      Parameters:
        `secureType` - the security type of the SMTP server

    - #### getUsername

          public java.lang.String getUsername()

      Gets the user name for authenticating into the SMTP server. Default user value from registry setting "/OpenPages/Applications/Common/Email/SMTP User Name".
      Returns:
        the user name for authenticating into the SMTP server.

    - #### setUsername

          public void setUsername(java.lang.String username)

      Sets the user name for authenticating into the SMTP server. Default user value from registry setting "/OpenPages/Applications/Common/Email/SMTP User Name".
      Parameters:
        `username` - the user name for authenticating into the SMTP server.

    - #### getPassword

          public java.lang.String getPassword()

      Gets the password for authenticating into the SMTP server. Default user value from registry setting "/OpenPages/Applications/Common/Email/SMTP Password".
      Returns:
        the password for authenticating into the SMTP server

    - #### setPassword

          public void setPassword(java.lang.String password)

      Sets the password for authenticating into the SMTP server. Default user value from registry setting "/OpenPages/Applications/Common/Email/SMTP Password".
      Parameters:
        `password` - the password for authenticating into the SMTP server

    - #### getPort

          public java.lang.String getPort()

      Gets the port number that identifies the SMTP server port. Refer for more detail.
      Returns:
        the port number identifies the SMTP server port.

    - #### setPort

          public void setPort(java.lang.String port)

      Sets the port number that identifies the SMTP server port. When the port value is left null, the port number is looked up from the registry setting "/OpenPages/Applications/Common/Email/SMTP Port". If the registry setting is also empty, the default values are used: 465 for SSL/TLS 587 for opportunistic TLS ( STARTTLS ) 25 for plain text
      Parameters:
        `port` - the port number identifies the SMTP server port.

    - #### getTimeout

          public int getTimeout()

      Gets the time out (in seconds) to send email.
      Returns:
        the time out (in seconds) to send email

    - #### setTimeout

          public void setTimeout(int timeout)

      Sets the time out (in seconds) to send email. Default is 30s (when 0 is applied). -1 is infinite timeout.
      Parameters:
        `timeout` - the time out (in seconds) to send email

    - #### getRetryTimes

          public int getRetryTimes()

      Gets the retry times to send email.
      Returns:
        the retry times to send email

    - #### setRetryTimes

          public void setRetryTimes(int retryTimes)

      Sets the retry times to send email. Default is 3.
      Parameters:
        `retryTimes` - the retry times to send email

Licensed Materials - Property of IBM
OpenPages with Watson (PID: 5725-D51)
© Copyright IBM Corporation 2013, 2022. All Rights Reserved.
US Government Users Restricted Rights - Use, duplication or disclosure restricted by GSA ADP Schedule Contract with IBM Corp.