sendForm(form, subject, [sendTo], [smtp], [subjectPrefix], [addSenderInfo]) Last updated: 12. Mar 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.
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.
subjectPrefix (optional) bool If subjectPrefix is not specified or null, the subject prefix "FORM: " used.
addSenderInfo (optional) bool If set to true, the sender's IP address and user agent will be included in the email. Default TRUE.

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");