sendForm(form, subject, [options]) Last updated: 20. Apr 2026
API only function
Sends a submitted form by email from an API function.
Parameters
| Name | Type | Description |
|---|---|---|
| form | object | Object where each property becomes a row in the email, in the same order as defined in the object. Only plain text is supported — HTML will not be rendered. Line breaks (\n) are preserved, so you can format the content using line breaks and UTF symbols (e.g. ✓, →, •). |
| 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 or array). |
| • smtp | string | Path to a SMTP configuration file, where you can specify sender address etc. |
| • subjectPrefix | bool | Custom prefix for the subject line. If not specified or null, "FORM: " is used. Pass an empty string to disable the prefix entirely. |
| • 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. |
| • sendToCc | email(s) | One or multiple emails to send as CC (csv or array). |
| • sendToBcc | email(s) | One or multiple emails to send as BCC (csv or array). |
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" });