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 | |
Capabilities¶
Attachments¶
- Message.Attachments: Retrieves the array of attachments for the message.
- Message.Attach: Attaches the given content as an attachment to the message.
- Message.AttachFile: Attaches the specified file as an attachment to the message.
- Message.AttachString: Attaches the given string as a plain text attachment to the message.
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) to5(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¶
- Message.GetHeader: Retrieves the value(s) of a header from the message.
- Message.GetHeaders: Retrieves an array containing all headers of the message.
- Message.SetHeader: Sets a custom header for the message.
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¶
- Message.MessageAttachment: Represents a mail attachment.
- Message.MessageContact: Represents a mail contact, such as a recipient or sender.
- Message.MessageHeader: Represents a mail header.