SEND

LANSA Integrator

SEND

The SEND command sends the email.

You can use the TO, CC, BCC, FROM and SUBJECT keywords in the SEND command to override the values set by the SMTPMailService properties file or the SET command.

If the SEND command has a working list argument the list entries will be used to create the message body. The first list field must contain the text and an optional second field is used to control the concatenation process. If no second field is present, or the field has a value of blank, then the default option value of NA is used.

The possible option values are:

     SB - Add a space before appending the text entry, except for the first entry.

     NB - Add a new line before appending the text entry, except for the first entry.

     SA - Add a space after appending the text entry, except for the last entry.

     NA - Add a new line after appending the text entry.

If the second field value is not one of the above then no additional action is taken and the next entry is appended to the previous entries.

 

                                                           Optional

 

 SEND ---------- TO ----------- value ---------------------------->

 

             >-- CC ----------- value ---------------------------->

 

             >-- BCC ---------- value ---------------------------->

 

             >-- FROM --------- value ---------------------------->

 

             >-- SUBJECT ------ value ---------------------------->

 

             >-- SIGNER ------- value ---------------------------->

 

             >-- MULTIPARTSIGNED --- *NO ------------------------->

                                     *YES

 

             >-- ENCRYPT ------ none ----------------------------->

                                *DES

                                *DES-EDE3

                                *RC2-40

                                *RC2-64

                                *RC2-128

 

             >-- CONTENT ------ *PLAIN --------------------------->

                                *HTML

                                value

 

             >-- BODY --------- value ---------------------------->

 

             >-- ENCODING ----- *DEFAULT -------------------------|

                                value

 

Keywords

TO

Allows the a single email address to be nominated for the email to be sent to.

Alternatively use the SET command to specify a single TO email or multiple TO emails.

CC

Allows a single email address to be nominated for the email to be "cc-ed" (carbon copied) to.

Alternatively use the SET command to specify a single CC email or multiple CC emails.

BCC

Allows a single email address to be nominated for the email to be "bcc-ed" (blind carbon copied) to.

Alternatively use the SET command to specify a single BCC email or multiple BCC emails.

FROM

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.

Alternatively this value may be specified in the SET command.

A FROM email address must be supplied to SEND an email.

SUBJECT

Indicates the subject of the email.

Alternatively this value may be specified in the SET command.

SIGNER

The signer value is comprised of two parts, the name and password in the format name:password. These values are used to access the appropriate private key store and security certificate information in the SMTP service properties.

To send signed emails, a private key and public certificate are needed by the SMTPMailServer. These two files must be identified in the SMTPMailService properties file for the email signer.

The X509 public certificate file to be used is obtained from the property signer.certificate.{name}.

The PKCS8 keystore file to be used is obtained from the property signer.keystore.{name}. The keystore password is the password component.

For example, if your signer name is SMTPSIGN your SMTPMailService properties file would include entries like:

 

signer.keystore.SMTPSIGN=test-input/smtp-signer-key.p8

signer.certificate.SMTPSIGN=test-input/smtp-signer-certificate.cer

 

Then to send a signed email you would issue a JSM command something like:

 

use builtin(jsmx_command) with_args(#jsmxhdle1 'send signer(SMTPSIGN:password)') TO_GET(#jsmxsts #jsmxmsg)

 

There is no need to send a public certificate to the party who receives the signed email. The public certificate is automatically included in the email.

Important: There is no need to send private key store files to the other party. Only public certificates are exchanged.

MULTIPARTSIGNED

Allows the service to send a signed message in multipart/signed.

*YES - Send message in multipart/signed format.

*NO - Do not send message in multipart/signed format. (Default)

ENCRYPT

Encryption is the process of transforming a clear-text message (plaintext) into a data stream which looks like a meaningless sequence of bits (ciphertext). A cipher is the mathematical function used to convert plaintext input into ciphertext output and vice versa.

If the email is to be encrypted, an encryption algorithm (cipher) must be specified. By default no encryption is applied to an email but the SMTPMailService supports the following block encryption ciphers:

*DES - Data Encryption Standard is a block cipher, (i.e. it operates on blocks of bits at a time), which uses a fixed-key-length algorithm. It uses 56-bit keys where any 56-bit number can be a key.

*DES-EDE3 Triple DES improves the security of DES by applying DES encryption three times using three different keys. This way the effective key length becomes 168 bits (56 x 3) making brute-force attacks virtually impossible.

*RC2-40, *RC2-64 and *RC2-128 - are versions of the RC2 encryption supporting 40, 64 and 128 bit encryption respectively. By definition RC2 encryption is a variable-key-length cipher which supports key lengths in the range of 40 to 128 bits in 8-bit increments.

Once the encryption algorithm has been determined the appropriate keys must be provided to encrypt and decrypt the email. All modern ciphers use keys together with plaintext as the input to produce ciphertext. The same or a different key is supplied to the decryption function to recover plaintext from ciphertext. The security of a cipher lies in not the details of the cipher (which are usually made public) but in the key.

To send encrypted emails requires the public certificates of all the email recipients.

The person receiving your email must send you their public X.509 certificate. Add an entry to SMTPMailService properties file for each email recipient indicating the location of their public X.509 certificate.

For example:

 

[email protected]=test-input/smtp-person-certificate.cer

 

CONTENT

The most commonly used email content-types are text/plain and text/html (corresponding to the values *PLAIN and *HTML).

The default content value of *PLAIN indicates a MIME type of text/plain and is used for simple text messages.

A value of *HTML indicates a MIME type of text/html should be applied to the body of the email allowing the body of the email to be formatted using HTML tags.

Alternative content-types can also be assigned using the appropriate type and subtype description.

For example, text/enriched.

BODY

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

Used to specify what encoding must be applied to the byte content to convert it to a Unicode string. The default value for the ENCODING keyword is *DEFAULT.

Refer to See ENCODING for more information.

Examples

RDML

Set up the subject of the email and include the body text of the email in a working list. Additional detail may have been defined using the SET and ADD commands prior to the SEND command, or default values from the SMTPMailService property file will be applied.

 

USE BUILTIN(TCONCAT) WITH_ARGS('SEND SUBJECT(' #SUBJECT ') SERVICE_LIST(TXT)') TO_GET(#JSMCMD)

USE BUILTIN(JSM_COMMAND) WITH_ARGS(#JSMCMD) TO_GET(#JSMSTS #JSMMSG #MESSAGE)

 

RDMLX

Set up the subject of the email and include the body text in a file. Additional detail may have been defined using the SET and ADD commands prior to the SEND command, or default values from the SMTPMailService property file will be applied.

 

#jsmcmd := 'send subject(' + #subject + ') body(emailtext.txt) encrypt(*DES)'

use builtin(jsmx_command) with_args(#jsmhandle #jsmcmd) to_get(#jsmsts #jsmmsg)