For the complete documentation index, see llms.txt. This page is also available as Markdown.

Exports

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.

  • reason:stringThe problem 🤭

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.",
})

Last updated