17.2. Sending Mail From a Script

You can send email from using the resource API functions with the external/email context, as in the following example, where params is an object containing the POST parameters.

var params =  new Object();
params._from = "openidm@example.com";
params._to = "admin@example.com";
params._cc = "wally@example.com,dilbert@example.com";
params._subject = "OpenIDM recon report";
params._type = "text/html";
params._body = "<html><body><p>Recon report follows...</p></body></html>";

openidm.action("external/email", params);

OpenIDM supports the following POST parameters.

_from

Sender mail address

_to

Comma-separated list of recipient mail addresses

_cc

Optional comma-separated list of copy recipient mail addresses

_bcc

Optional comma-separated list of blind copy recipient mail addresses

_subject

Email subject

_body

Email body text

_type

Optional MIME type. One of "text/plain", "text/html", or "text/xml".