# SENDEMAIL

#### Syntax

**SENDEMAIL**(*to*; *replyTo*; *subject*; *body*; *attachment;attachmentFileName*)

* *to* - address of the recipient - ***Value type**: text*
* *replyTo* - the reply-to address - ***Value type**: text*
* *subject* - the subject line of the email - ***Value type**: text*
* *body* - the body of the email - ***Value type**: text*
* *attachment -* the internal name of the file which should be attached to the email - ***Value type**: text (optional, default: empty - no file is attached)*
* *attachmentFileName -* the assigned name of the attached file - ***Value type**: text (optional, default: attachment, i.e. the internal file name is used as name of the attachment)*

#### Remarks

* The parameter *to* can be a column range containing a list of recipients.
* The parameter *attachment* must be the name of a file which has been generated on the nedyx server, including its extension (e.g. .pdf, .zip, ....
* The parameter *attachment* can be a column range containing a list of internal names of the files, which should be attached to the email.
* The parameter *attachmentFileName* can be a column range containing a list of names, which should be used for the according *attachment*.

#### Examples

*Example 1* - SENDEMAIL without an attachment

<figure><img src="https://content.gitbook.com/content/4X6nN2wTlDsVpd8P1WDM/blobs/zxISSuF7RY4M61e7G3TF/grafik.png" alt=""><figcaption></figcaption></figure>

*Example 2* - SENDEMAIL with one attachment

In the next example, clicking the **Send Email** button below creates a pdf file containing the page  "SalesDashboard".

Afterwards, the generated PDF file is sent as an email attachment by calling the SENDEMAIL function.

<figure><img src="https://content.gitbook.com/content/4X6nN2wTlDsVpd8P1WDM/blobs/AYtsxgsHp0O8nXp0zaIo/image.png" alt=""><figcaption></figcaption></figure>

*Example 3* - As in example 2, but with four attachments to which suitable file names are assigned.

<figure><img src="https://content.gitbook.com/content/4X6nN2wTlDsVpd8P1WDM/blobs/FPkr8mu27Uxx01ErpTM4/image.png" alt=""><figcaption></figcaption></figure>
