Skip to main content
Skip table of contents

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

SQL
CALL "UTILS.sendMail"(
    "Recipients" => 'string_Recipients',
    "Subject" => 'string_Subject',
    "Body" => 'string_Body',
    "AttachmentName" => array('string_AttachmentName'),
    "Attachment" => array(blob_Attachment),
    "AttachmentMimeType" => array('string_AttachmentMimeType')
)

Parameters

ParameterDescription
hostnameNew SMTP server hostname
portNew SMTP server port
sslNew SSL setting
starttlsNew TLS setting
usernameNew SMTP server username
passwordNew SMTP server unencrypted password. To set an encrypted password, importSmtpConfiguration may be used
fromAddrNew email address to be used as a "from" address; mandatory

Example

SQL
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')
) ;;
JavaScript errors detected

Please note, these errors can depend on your browser setup.

If this problem persists, please contact our support.