Skip to content

Message

Represents an e-mail message.

Remarks

Create a message with $Messages.New, set its recipients, subject and body, attach files, and call Message.Send. Sending adds the message to the outgoing mail queue, and a background job delivers it; use Message.SendAfter to delay the delivery. A message without any recipient is not sent.

Examples

Send a notification with an attachment

1
2
3
4
var msg = $Messages.New('[email protected]', 'Order approved', 'Your order has been approved.');

msg.AttachFile($Xml.Evaluate('OrderFile'));
msg.Send();

Capabilities

Attachments

Properties

  • Message.BCCList: Retrieves the array of "BCC" (blind carbon copy) recipients for the message.
  • Message.CCList: Retrieves the array of "CC" (carbon copy) recipients for the message.
  • Message.Date: Gets or sets the message date. This property is optional. If not specified, the current date is used.
  • Message.DeleteAfter: Gets or sets the date after which the message should be deleted. This property is optional.
  • Message.Id: Gets or sets the message ID. Optional.
  • Message.SendAfter: Gets or sets the date after which the message should be sent. This property is optional.
  • Message.SendBefore: Gets or sets the date before which the message should be sent. This property is optional.

Content and Metadata

  • Message.Body: Gets or sets the message body.
  • Message.From: Gets or sets the message sender.
  • Message.Priority: Gets or sets the message priority, from 0 (None) to 5 (Critical). If it is not set, the normal priority (2) is used.
  • Message.ReplyTo: Gets or sets the message reply-to address. This property is optional.
  • Message.Signature: Retrieves the signature of the message, if present.
  • Message.Subject: Gets or sets the message subject.

Recipients

  • Message.ToList: Retrieves the array of "To" recipients for the message.
  • Message.BCC: Adds a "BCC" (blind carbon copy) recipient to the message.
  • Message.CC: Adds a "CC" (carbon copy) recipient to the message.
  • Message.To: Adds a "To" recipient to the message.

Headers

Delivery and Serialization

  • Message.Send: Saves a message to be sent asynchronously.
  • Message.ToXml: Retrieves the serialized XML representation of the message. Attachment contents are included as Base64 data.

Other