Syntax

	sendMail(
  subject: "Hello world!", 
  to: "Mr. Foobar <foo@bar.com>", 
  body: {{{
     <h1>Hello {$receiver}<h1>
     <p>...</p>
  }}},
  attachments: [
    binary(...),
    {
      "cid": "attachment1",
      "data": binary(...)
    }
  ],
  cc: ["info@foo.com", "bar@foo.com"], 
  bcc: "hidden@foobar.com"
)

Description

Sends an e-mail with the specified parameters. To be able to use this function, e-mail dispatch must be activated in the application.

Parameters

Email name Type Type Description Mandatory Default
subject Character string The subject of the e-mail Yes
to Character string/list of character strings The recipient(s) of the email. For reasons of data protection, only one recipient should ever be specified for a mass e-mail and the function should be called up individually for all recipients. Yes
body Character string/HTML/binary data The content of the email. yes
attachments List of binary data or attachment descriptions (see below) Additional content that is sent in the email. no []
cc Character string/list of character strings List of recipients who should receive a copy of the e-mail no []
bcc String/list of strings List of recipients who should receive a copy of the e-mail without the other recipients seeing their e-mail addresses. no []

Return value

Type: Truth value

Whether the email was sent successfully.

Attachment description

Either a binary value can be passed directly as an attachment or a JSON object that describes the attachment in more detail:

{
    "filename": "policies.pdf",
    "disposition": "attachment",
    "description": "Some attachment.",
    "cid": "id1",
    "headers": {
        "key": "value"
    },
    "data": $binaryData
}

The attributes of the attachment description have the following meaning: