--- title: "send mail()" slug: "basic-send-mail" updated: 2026-08-12T11:58:50Z published: 2026-08-12T11:58:50Z canonical: "docs.lobstersoftware.com/basic-send-mail" --- > ## Documentation Index > Fetch the complete documentation index at: https://docs.lobstersoftware.com/llms.txt > Use this file to discover all available pages before exploring further. # 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 **, 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 ** 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()](/v1/docs/en/system-read-encoded-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 e-mail is created, which means that you can use formatting (such as **) 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** | | | | | **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.* | A central data record in partner management that consolidates the connection parameters for a communication partner, such as the URL, access credentials, and protocol. Changes to a channel immediately affect all profiles, ASM entries, and content inspection entries that use that channel. The Integration Server is the central runtime component of the Lobster Data Platform. It executes integration processes and processes data. The Integration Server stores local certificates and uses their private keys for signing and decryption. It provides all communication services (e.g., FTP, SMTP, HTTP) and connects the application to the database. It is managed via the Admin console.