Skip To Content

INTEGRAL

INTEGRAL DSL Reference Guide

Jump directly to: 

::my.app.Email(flags, body, subject, smtp_host, user_auth, from_addr, to_addr, cc_addr = "", bcc_addr = "", from_name = "", to_name = "", cc_name = "", bcc_name = "")

This function sends an email message using INTEGRAL Application Server's default mail user agent.

Parameters

flags

A bitmask that can be used to customize the behavior of the function.

body

A string representing the body of the email message.

subject

A string representing the subject of the email message.

smtp_host

A string representing the SMTP host to be used by mail user agent when sending the email message.

user_auth

A string representing the SMTP authentication to be used by mail user agent when sending the email message.

from_addr

A string representing the "From" email address.

to_addr

A string representing the "To" email address.

cc_addr

A string representing the "Cc" email address.

bcc_addr

A string representing the "Bcc" email address.

from_name

A string representing the name associated with the "From" email address.

to_name

A string representing the name associated with the "To" email address.

cc_name

A string representing the name associated with the "Cc" email address.

Return Value

The function returns DV_RET_OK on success and a non-positive value on failure.

Notes

INTEGRAL Application Server uses curl as its default mail user agent.

Example 1

local body = "This is a sample message sent in order to test email delivery. Please confirm receipt.\n\nThank You,\nINTEGRAL staff";
local subject = "Sample message";
local smtp_host = "smtps://smtp.example.com";
local user_auth = "user@example.com:password123";
local from_addr = "sender@example.com";
local to_addr = "recepient@destination.com";

::my.app.Email(1, body, subject, smtp_host, user_auth, from_addr, to_addr);

Example 2

local body = "Hi Patricia,\n\nI hope you received my recommendation letter for Raul Payette. Let me know if you have any questions.\n\nThanks,\nJim Olsen";
local subject = "Recommendation Letter for Raul";
local smtp_host = "smtps://smtp.example.com";
local user_auth = "user@example.com:password123";
local from_addr = "jim_olsen@integral.ws";
local to_addr = "Patricia.Smit@pixelsolutions.com";
local cc_addr = "support@integral.ws";
local bcc_addr = "";
local from_name ="Jim Olsen";
local to_name = "Patricia Smit";
local cc_name = "INTEGRAL Support";
local bcc_name = "";

::my.app.Email(0, body, subject, smtp_host, user_auth, from_addr, to_addr, cc_addr, bcc_addr, from_name, to_name, cc_name, bcc_name);