Skip to content

Send

Saves a message to be sent asynchronously.

1
myMessage.Send():void

Remarks

This method saves the message to be sent in the background and does not wait for the message to be sent immediately. Sending is a no-op when the message has no To, CC, or BCC recipient; otherwise the worker pool is signaled after the message is queued.

Examples

Send a message with an attachment

1
2
3
4
5
var msg = $Messages.New($Xml.Evaluate('Customer/EMailAddress'));
msg.Subject = 'Invoice ' + $Xml.Evaluate('InvoiceNumber');
msg.Body = '<p>Please find your invoice attached.</p>';
msg.AttachFile($Xml.Evaluate('InvoiceFile'));
msg.Send();