> For the complete documentation index, see [llms.txt](https://docs.av-scripts.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.av-scripts.com/laptop-pack/mail/exports.md).

# Exports

{% tabs %}
{% tab title="server" %}

#### sendMail(to,from,subject,body)

> Use the following export to send an email to one or multiple accounts.
>
> **params:**
>
> * **to:**`string|string[]` A single mail or an array of email addresses that will receive a copy of the email.
> * **from:**`string` The sender address, shown to recipients.
> * **subject?:**`string` the subject line.
> * **body?:**`string` the message text (supports line breaks and emojis)
> * **attachments?:**`table[]` A list of file references from laptop\_files table in database.
>
> **returns:**
>
> * **sent:**`boolean` true if message was sent or false if there was a problem.&#x20;
> * **reason**:`string`The problem :face\_with\_hand\_over\_mouth:
>
> {% code title="" %}
>
> ```lua
> local sent, output = exports['av_mail']:sendMail({
> --    to = "boss@lspd.com", -- single recipient example
>     to = { -- multiple recipients example, should be a table
>         "chief@lspd.com",
>         "dispatch@lspd.com",
>         "officer.doe@lspd.com",
>     },
>     from    = "system@avscripts.com",
>     subject = "Shift update",
>     body    = "The evening shift starts one hour earlier today.",
> })
> ```
>
> {% endcode %}
> {% endtab %}
> {% endtabs %}
