sendMail
The sendMail procedure can be used to send emails through an SMPT server.
To use it, a properly configured SMTP server is needed. An SMTP server can be configured using the setSmtpConfiguration procedure.
Usage
CALL "UTILS.sendMail"(
"Recipients" => 'string_Recipients',
"Subject" => 'string_Subject',
"Body" => 'string_Body',
"AttachmentNames" => array('string_AttachmentName'),
"Attachments" => array(blob_Attachment),
"AttachmentMimeTypes" => array('string_AttachmentMimeType'),
"MaxRetries" => integer_MaxRetries,
"ResponseTimeout" => integer_ResponseTimeout
)
Parameters
Parameter | Description |
|---|---|
| Comma-separated list of recipients |
| Email subject |
| Email body |
| Array of attachment names |
| Array of attachments |
| Array of attachments MIME types |
| Maximum number of retry attempts for sending the email. If |
| Timeout (in seconds) for the SMTP server response. If |
Example
CALL "UTILS.sendMail"(
"Recipients" => 'example@example.org',
"Subject" => 'Testmail',
"Body" => 'Hello world.',
"Attachments" => array(
(SELECT file FROM (CALL "file.getFiles"() ) a WHERE a.filePath like 'currencyconvertor.asmx'),
(SELECT file FROM (CALL "file.getFiles"() ) a WHERE a.filePath like 'currencyconvertor.wsdl')
),
"AttachmentNames" => array('currencyconvertor.asmx', 'currencyconvertor.wsdl'),
"AttachmentMimeTypes" => array('application/asmx', 'application/wsdl'),
"MaxRetries" => 2,
"ResponseTimeout" => 30
) ;;
MaxRetries and ResponseTimeout parameters are available since v25.3