public class EmailUtil
extends java.lang.Object
Constructor and Description |
---|
EmailUtil() |
Modifier and Type | Method and Description |
---|---|
static void |
connect(EmailOptions options) |
static void |
defaultSendEmail(java.lang.String from,
java.lang.String recipients,
java.lang.String subject,
java.lang.String body,
boolean ignoreError)
This method sends out an email by using an internal SMTP service.
|
static java.lang.String |
getFromAddress() |
static java.lang.String |
getServer() |
static void |
secureSendEmail(java.lang.String from,
java.lang.String recipients,
java.lang.String subject,
java.lang.String body,
boolean ignoreError,
java.lang.String secureType,
java.lang.String encryptedUsername,
java.lang.String encryptedPassword,
java.lang.String port)
This method sends out email by using a secured SMTP services.
|
static void |
sendEmail(EmailOptions options)
Send email
|
static void |
sendEmail(java.lang.String from,
java.lang.String recipients,
java.lang.String subjectTextKey,
java.lang.Object[] subjectParams,
java.lang.String bodyKey,
java.lang.Object[] bodyParams,
boolean ignoreError,
Context context,
java.lang.StringBuffer linkBuffer,
java.util.Locale locale)
Send email by using OpenPages Application Strings.
|
static void |
sendEmailBySecuredServer(java.lang.String from,
java.lang.String recipients,
java.lang.String subjectTextKey,
java.lang.Object[] subjectParams,
java.lang.String bodyKey,
java.lang.Object[] bodyParams,
boolean ignoreError,
Context context,
java.lang.String secureType,
java.lang.String username,
java.lang.String password,
java.lang.String port,
java.lang.StringBuffer linkBuffer,
java.util.Locale locale)
Send out emails by using a secured SMTP server and gets Subject and Body
from OpenPages application string.
|
static void |
validateEmailSvr()
This validates that the email server was properly configured and is active
|
public static void connect(EmailOptions options) throws java.lang.Exception
java.lang.Exception
public static java.lang.String getServer()
public static java.lang.String getFromAddress()
public static void sendEmail(EmailOptions options) throws java.lang.Exception
options
- the email options.java.lang.Exception
public static void sendEmail(java.lang.String from, java.lang.String recipients, java.lang.String subjectTextKey, java.lang.Object[] subjectParams, java.lang.String bodyKey, java.lang.Object[] bodyParams, boolean ignoreError, Context context, java.lang.StringBuffer linkBuffer, java.util.Locale locale) throws java.lang.Exception
from
- (required) the email address identifies where this email was sent from.recipients
- (required) the email address which will receive the email. Could be a
comma separated string for multiple recipients.subjectTextKey
- the key is used to locate the application string for subject.subjectParams
- parameters that will be formated into subject text.bodyKey
- the key is used to locate the application string for body.bodyParams
- parameters that will be formated into body text.ignoreError
- (required) Boolean value identifies whether to continue sending email when an
error occurred.context
- (required) API contextlinkBuffer
- the StringBuffer for a URL that points to the object in OpenPages with Watson.locale
- used to get translated application texts for subject and body.java.lang.Exception
public static void sendEmailBySecuredServer(java.lang.String from, java.lang.String recipients, java.lang.String subjectTextKey, java.lang.Object[] subjectParams, java.lang.String bodyKey, java.lang.Object[] bodyParams, boolean ignoreError, Context context, java.lang.String secureType, java.lang.String username, java.lang.String password, java.lang.String port, java.lang.StringBuffer linkBuffer, java.util.Locale locale) throws java.lang.Exception
from
- (required) the email address identifies where this email was sent from.recipients
- (required) the email address which will receive the email. Could be a
comma separated string for multiple recipients.subjectTextKey
- the key is used to locate the application string for subject.subjectParams
- parameters that will be formated into subject text.bodyKey
- the key is used to locate the application string for body.bodyParams
- parameters that will be formated into body text.ignoreError
- (required) Boolean value identifies whether to continue sending email when an
error occurred.context
- (required) API contextsecureType
- (required) the security type of the SMTP server. Now supports SSL and TLS.username
- user name for authenticating into the SMTP server.
Default use value from registry setting "/OpenPages/Applications/Common/Email/SMTP User Name".password
- password for authenticating into the SMTP server.
Default use value from registry setting "/OpenPages/Applications/Common/Email/SMTP Password".port
- the port number identifies the secured server port.
Default port for SSL is 465.
Default port for TLS is 587.linkBuffer
- the StringBuffer for a URL that points to the object in OpenPages with Watson.locale
- used to get translated application texts for subject and body.java.lang.Exception
public static void defaultSendEmail(java.lang.String from, java.lang.String recipients, java.lang.String subject, java.lang.String body, boolean ignoreError) throws java.lang.Exception
from
- (required) the email address identifies where this email was sent from.recipients
- (required) the email address which will receive the email. Could be a
comma separated string for multiple recipients.subject
- (required) the subject of the emailbody
- (required) the body of the emailignoreError
- (required) Boolean value identifies whether to continue sending email when an
error occurred.java.lang.Exception
public static void secureSendEmail(java.lang.String from, java.lang.String recipients, java.lang.String subject, java.lang.String body, boolean ignoreError, java.lang.String secureType, java.lang.String encryptedUsername, java.lang.String encryptedPassword, java.lang.String port) throws java.lang.Exception
from
- (required) the email address identifies where this email come from.recipients
- (required) the email address which will receive the email. Could be a
comma separated string for multiple recipients.subject
- (required) the subject of the email.body
- (required) the body of the email.ignoreError
- (required) Boolean value identifies whether to continue sending email when an
error occurred.secureType
- (required) the security type of the SMTP server. Now supports SSL and TLS.encryptedUsername
- user name for authenticating into the SMTP server.
Default use value from registry setting "/OpenPages/Applications/Common/Email/SMTP User Name".encryptedPassword
- password for authenticating into the SMTP server.
Default use value from registry setting "/OpenPages/Applications/Common/Email/SMTP Password".port
- the port number identifies the secured server port.
Default port for SSL is 465.
Default port for TLS is 587.java.lang.Exception
public static void validateEmailSvr() throws java.lang.Exception
java.lang.Exception
- if the email server is not properly configured
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.