sendForm(form, subject, [options]) Last updated: 11. Dec 2025
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. |
| subject | string | Subject of email, prefixed with "FORM: " if subjectPrefix is not set or null. |
| options (optional) | object | Specify any of the following options parameters: |
| • sendTo | email(s) | One or multiple emails to send to (csv). |
| • smtp | string | Path to a SMTP configuration file, where you can specify sender address etc. |
| • subjectPrefix | bool | If subjectPrefix is not specified or null, the subject prefix "FORM: " used. |
| • addSenderInfo | bool | If set to true, the sender's IP address and user agent will be included in the email. Default TRUE. |
| • description | string | Sub header text for email body. |
| • attachments | object[] | An array of objects with property "Filename" and "Data". Filename - name of file. Data - array of bytes or base64 encoded string. |
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", { sendTo: "test@docly.net" });