SendForm(form, formName, [sendTo], [smtp]) Last updated: 19. Jan 2024

API only function

Use this function to send a submitted form by email from an API function.

Parameters

Name Type Description
form object Object where each property is added as a row in the notification.
formName string Name to include in subject of email.
sendTo (optional) email(s) One or multiple emails to send to (csv).
smtp (optional) string Path to a SMTP configuration file, where you can specify sender address etc.

Returns

True if successful or throws an error if sending fails.

Example

Code example (JS)

JS is normal JavaScript either running in the browser or on the Docly™ server.
let form = {
    "Message" : "This is just an example",
    "Link" : "https://docly.org"
}
docly.SendForm(form, "Contact form", "test@docly.net");