5.27.3 SET
This command is used to prepare the email and can be called many times with one or more keywords to build up the email definition before it is sent. (This is especially useful in RDML where the command length is limited to 256 characters).
The SET keyword must be used before the SEND keyword.
Comments / Warnings
Any keyword values set up using the SET command will be overridden by use of the equivalent keyword on the SEND command.
Syntax:
Command |
Keyword |
Value |
Developer notes |
SET |
SERVER |
host |
Conditional. Remote host. |
PORT |
integer |
SMTP server port. |
|
SECURE |
*NO |
Default. No secure connection. |
|
*YES |
Use implicit connection. |
||
*IMPLICIT |
Implicit connects to port 465 using SSL. |
||
*EXPLICIT |
Explicit connects to port 587 and upgrades to a TLS session. |
||
TO |
value |
A single email address can be specified using the TO keyword in the SEND command. At least one TO email address must be supplied to SEND an email. |
|
*LIST |
Include a single email address or the *LIST value to nominate any "to" addresses. The *LIST value is used if the email is to be sent to more than one email address. The list of email addresses is passed using the service list. The first field is the address and the optional second field is the display name. |
||
CC |
value |
Include a single email address or the *LIST value to nominate any "copy to" addresses. Alternatively, a single email address can be specified using the CC keyword on the SEND command. |
|
*LIST |
The *LIST value is used if more than one CC email address is required. The list of email addresses is passed using the service list. The first field is the address and the optional second field is the display name. |
||
BCC |
value |
Include a single email address or the *LIST value to nominate any "blind copy to" addresses. Alternatively, a single email address can be specified using the BCC keyword on the SEND command. |
|
*LIST |
The *LIST value is used if more than one BCC email address is required. The list of email addresses is passed using the service list. The first field is the address and the optional second field is the display name. |
||
FROM |
value |
The email address this message originated from. The FROM property is typically configured in the SMTPMailService properties file as it usually does not change, and this ensures a consistent FROM email address which can be easily changed in just one location if required. Alternatively, this value may be specified on the SEND command. A FROM email address must be supplied to SEND an email. |
|
FROM_NAME |
value |
Indicates a text name to be displayed as the "from" email display name. If a name is not supplied the FROM email address will be displayed. The FROM_NAME property is typically configured in the SMTPMailService properties file as it usually does not change, and this ensures a consistent FROM_NAME to match the configured FROM email address. |
|
SUBJECT |
value |
Indicates the subject of the email. |
|
USER |
value |
The user profile used to login to the SMTP server. The user name may be case sensitive depending on the SMTP server. |
|
PASSWORD |
value |
This is the password used to login to the SMTP server. The password may be case sensitive depending on the SMTP server. |
|
MAILDOMAIN |
domain name |
The MAILDOMAIN property is typically configured in the SMTPMailService properties file. |
|
NTLMDOMAIN |
domain name |
This is the NTLM domain for NTLM authentication. |
|
CHARSET |
value |
The character set encoding to be applied to body text and the subject. |
|
SIMPLIFY |
*YES |
Simplify a multipart plain text message into a simple plain text message. |
|
*NO |
Default. |
||
HEADER |
*NONE |
The *NONE value clears the all headers. |
|
*LIST |
The *LIST value is used supply a list of name values. The first field is the field and the second field is the value. This allows MIME header fields to be sent with the message. |
||
CONTENT |
*NONE |
Clear all three text messages. |
|
*PLAIN |
Default. Create text/plain content. |
||
*HTML |
Create text/html content. |
||
mimetype |
This allows up to three multipart/alternative text messages to be sent. |
||
BODY |
value |
A file can be nominated to contain the body text. If the specified file does not exist, the body text is created from the service list argument if it is provided. |
|
ENCODING |
value |
Used to specify what encoding must be applied to the byte content to convert it to a Unicode string. Refer to ENCODING for more information. |
|
KEYSTORE |
name:password |
Read keystore file. |
Example
SET TO(*LIST) #WRKLST(ADDRESS,NAME)
SET FROM(me@company.com) TO(you@company.com)
SET CONTENT(*HTML) #WRKLST(TXT,CNTRL)
SET CONTENT(*PLAIN) #WRKLST(TXT,CNTRL)
SET HEADER(*LIST) #WRKLST(NAME,VALUE)
SET KEYSTORE(SMTPMAIL:PASSWORD)
keystore.smtpmail=pki/smtpmail.pfx