Application Programming Interface Guide > Built-in Procedures > Procedures Reference > SendEMail
 
SendEMail
Send an email message with the specified headers and content. It supports only NULL for the from address.
Location
/lib/util/
Syntax
SendEmail (IN from VARCHAR (4096),
IN replyTo VARCHAR (4096),
IN to VARCHAR (4096),
IN cc VARCHAR (4096),
IN bcc VARCHAR (4096),
IN subject VARCHAR (4096),
IN contentType VARCHAR (4096),
IN content VARCHAR (4096))
Inputs
from: The address the message is from. NULL causes use of the server’s configured from-address. Only NULL is supported.
replyTo: The address to place in the replyTo field of the message.
to: A comma-separated list of email addresses.
cc: A comma-separated list of email addresses.
bcc: A comma-separated list of email addresses.
subject: The message subject.
contentType: TEXT_PLAIN or TEXT_HTML.
content: The message body.
Outputs
N/A
Exceptions
IllegalArgumentException: If from is not NULL.
IllegalArgumentException: If any of the address lines are malformed.
IllegalArgumentException: If there is not at least one to-address.
IllegalArgumentException: If there is more than one address in replyTo.
IllegalArgumentException: If contentType is not TEXT_PLAIN or TEXT_HTML.
IllegalStateException: If the server’s from-address is not configured.
Example
PROCEDURE proc_SendEMail()
BEGIN
PATH /shared/sources/proceduresForDoc;
CALL proc_GetProperty();
CALL SendEMail(NULL, NULL, 'joe@smith.com',
                       NULL, NULL, 'hi', 'TEXT_PLAIN', NULL);
END