send mail()

This function sends a mail with subject f and mail message g. If i is defined, the value will be converted to binary data using charset ISO-8859-1 and is attached to the mail. If i is set to <file>, the input data - if it exists - is attached. In both cases the attachment's filename is Attachment.txt. Optional parameter k can be used to define the attachment name, otherwise, it will be Attachment.txt.

b will be used as sender address, e contains a comma-separated list of recipient addresses the mail should be sent to. Alternatively, it is possible to set the ID of a channel of type "Mail" in parameter e. In that case, all settings of that channel are used and the parameter a to d can be left empty. If these parameters are defined nevertheless, these values will 'overwrite' the channel's settings. The channel needs to be configured with settings for SMTP or ASMTP. CC or BCC recipients may be addressed by cc:xxx or bcc:xxx (where xxx is the mail address).

If j=true, the return value is true for successful sending or false for error. If j=false, the function will terminate with an error if a sending error occurs.

Parameters


Parameter

Description

a

Hostname or IP address of the mail server.

b

Address of the mail sender.

c

(optional) Username to be used for authentication to the mail server. Default: none.

d

(optional) Password to be used for authentication to the mail server. Default: none.

e

ID of the channel or a comma-separated list of recipient addresses.

f

Mail subject.

g

Mail message.

h

(optional) Port of the mail server. Default: 25.

i

(optional) Attachment data (as string) or placeholder <file> if the input data should be attached. Note: To attach a file from the file system, the file must first be read in with the function "read file()". Please read in binary files in encoding 8859_1.

j

(optional) If set to true, the return value is true or false for the success or fail of operation. If j is false, an exception is thrown for any error. Default: false.

k

(optional) Attachment name. If no value is set, the name will be Attachment.txt.

l

(optional) If set to true, an HTML email is created, which means that you can use formatting (such as <b>) in the mail body.

m

(optional) Protocol to be used. Allowed values: smtp , smtps, smtpes . Default: smtp

Examples


Parameter a

192.168.212.12

192.168.212.12

192.168.212.12

Parameter b

sender@example.com


newsender@example.org

Parameter c




Parameter d




Parameter e

rec1@example.org,cc:rec2@example.org

1234567890

1234567890

Parameter f

Infomail

Infomail

Infomail

Parameter g

Mailtext

Mailtext

Mailtext

Parameter h




Parameter i



<file>

Parameter j

true

true

true

Parameter k



Order.csv

Parameter l




Parameter m




Result

Sends a mail to the both recipients at example.org with a mail text and without an attachment using the default settings of the Integration Server.

Sends a mail without attachment to the recipient specified in the channel (given by the ID).

Sends a mail containing the input data as attachment to the recipient specified in the channel (given by the ID), but with a different sender address. The attachment name is Order.csv.