0

sendEmail

To send an email out of Ninox

With this function, you can send emails right out of Ninox. You can enter email details directly to the function or pull them from the respective fields.

As the sending is done via the Ninox servers, the sender has to be a member of the workspace.

❗ There is no immediate feedback that the email has been sent successfully, nor is it stored in the database. So we recommend using "cc" or "bcc" to send a copy to your email address.

💡 This function is best used in a button.

Syntax

sendEmail(JSON)

Return

any

Examples

cc, bcc, and attachments are optional.

sendEmail({
    from: "support@example.com",
    to: "customer123@example.com",
    cc: "contact456@example.com",
    bcc: "noreply@example.com",
    subject: "Thank you for your email",
    text: "We received your request to get another copy of your invoice",
    html: "Some text with markup",
    attachments: Invoice_220801
})

Result: An email with an attached invoice will be sent from support@example.com.

You can use the replyTo parameter to set a specific email address for recipients to respond to when they use the reply option in their email program. Ensure that the email address provided in replyTo is valid.

sendEmail({
    from: "support@example.com",
    to: "customer123@example.com",
    replyTo: "reply@example.com",
    cc: "contact456@example.com",
    bcc: "noreply@example.com",
    subject: "Thank you for your email",
    text: "We received your request to get another copy of your invoice",
    html: "Some text with markup",
    attachments: Invoice_220801
})

Result: An email with an attached invoice will be sent from support@example.com. If the reply option is used, the reply email will be sent to reply@example.com.Multiple addresses can be specified in the “to”, ‘cc’, and “bcc” parameters by passing the addresses as comma-separated text or as a text array. The addresses can be passed either directly or with names included

Option 1:
    to: "customer123@example.com, customer456@example.com",

Option 2:
    to: "Customer 123 <customer123@example.com>, Customer 456 <customer456@example.com>",

Option 3:
    to: ["customer123@example.com", "customer456@example.com"],

Option 4:
    to: ["Customer 123 <customer123@example.com>", "Customer 456 <customer456@example.com>"]

Result: The email is sent to all addresses listed in the array or separated by commas in the text.

💡 If several attachments need to be sent, they can be provided in an array, e. g. attachments: [Image1, Image2, Image3].

❗This function - like the invitation / validation / password reset features - uses an online SMTP service for delivering emails. To make the email appear to be sent from the intended sender, this service "masks" the email accordingly. There are certain email receiving clients (like Gmail, T-Online, etc.) that often mark masked emails as spam by default.

To prevent this from happening, the appropriate SPF / DKIM / DMARC values can be added to the DNS configuration of the sender's domain (for "sender@myemail.com" the domain would be "myemail.com"). To receive these values for the configuration you can send us a message via the Contact form in which you list the domains from which you are trying to send.

See also

http which sends an HTTP request.

💡 Do you want to dive deeper into the topic? Take a look at the corresponding part of our video tutorial.

Reply

null