5.28.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.
The SERVER property is typically included in the SMTPMailService properties file but if not, it must be provided here.

AUTH

*XOAUTH2

Token based authentication.

TIMEOUT.READ

Value

The read timeout is the timeout on waiting to read data. If the server (or network) fails to deliver any data <timeout> seconds after the client makes a socket read call, a read timeout error will be raised.
Default value
timeout.read = 90000

TIMEOUT.WRITE

Value

A write timeout defines a maximum time of inactivity between two data packets when sending the request to the server.
Default value
timeout.write = 90000

TIMEOUT.CONNECTION

Value

A connect timeout defines a time period in which the client should establish a connection with a target host.
Default value
timeout.connection = 90000

PORT

integer

SMTP server port.
Default is 25.

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.

Alternatively this value may be specified on the SEND command.

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.

This is the mail domain issued by the SMTP HELO subcommand to identify the server initiating the mail transaction.

NTLMDOMAIN

domain name

This is the NTLM domain for NTLM authentication.

The NTLMDOMAIN property is typically configured in the SMTPMailService properties file.

CHARSET

Value

The character set encoding to be applied to body text and the subject.

The default value applied is iso-8859-1.

The CHARSET property is typically configured in the SMTPMailService properties file.

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.

The MIME type value creates the custom content, that is, text/enriched.

See SEND command on how to create the body text from the working list argument.

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.

If the BODY keyword is used any reference to a working list is ignored as the body text is taken from the file and converted to Unicode using the ENCODING keyword value.

ENCODING

value

Used to specify what encoding must be applied to the byte content to convert it to a Unicode string.

The default value is *DEFAULT.

Refer to ENCODING for more information.

CLIENT.ID

Value

The client_id is a public identifier for apps. Even though it’s public, it’s best that it isn’t guessable by third parties, so many implementations use something like a 32-character hex string.

Ex- Foursquare: ZYDPLLBWSK3MVQJSIYHB1OR2JXCY0X2C5UJ2QAR2MAAIT5Q

CLIENT.SECRET

Value

The client_secret is a secret known only to the application and the authorization server. It is essential the application’s own password. It must be sufficiently random to not be guessable, which means you should avoid using common UUID libraries which often take into account the timestamp or MAC address of the server generating it.

Ex - A great way to generate a secure secret is to use a cryptographically-secure library to generate a 256-bit value and then convert it to a hexadecimal representation.

In PHP, you can use the random_bytes function and convert to a hex string:

bin2hex(random_bytes(32));

Lq08Q~EtgN-BpoINX6msRD9GL_cCx

AUTH.TOKEN.ENDPOINT

value

Token endpoint is used by the application in order to get an access token or a refresh token. It is used by all flows except for the Implicit Flow because in that case an access token is issued directly.

Ex -https://login.microsoftonline.com/5c951c05-0f75-44ef-6223f150a449/oauth2/v2.0/token

AUTH.SCOPE

Value

Scope is a way to limit an app’s access to a user’s data. Rather than granting complete access to a user’s account, it is often useful to give apps a way to request a more limited scope of what they are allowed to do on behalf of a user.

Ex- https://outlook.office365.com/.default

TOKEN.CACHE

Value

This is a boolean parameter to save the token at the mentioned directory. It can have two values- true or false.

Ex - Token.cache = true In this case generated token will be saved at the path mentioned in

Token.cache.dir parameter.

TOKEN.CACHE.DIR

Value

It is a directory where user wants to save the token while caching.

Ex- C:\Program Files (x86)\LANSA\dummy

SESSION.DEBUG

Value

Enable session debugging to display debugging messages in the user interface.

Ex- true or false

RECIPIENT.CERTIFICATE.{TOADDRESS}

Value

It referred to as email signing certificates or personal authentication certificates.

Ex- recipient.certificate.myperson@mycompany=pki/myperson.cer

KEYSTORE

name:password

Read keystore file.

The keystore value is in the format of name:password. The keystore file to be read is obtained from the property keystore.{name}.

The keystore password is the password component.

 

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