MailItem

MailItem[]

represents an item of mail associated with an active mail server connection.

Details

  • Lists of MailItem[] objects are typically obtained using MailSearch[], or from properties of MailFolder[] objects.
  • MailItem[] displays in StandardForm with subject and body snippet, as in a typical mail client program.
  • MailItem[]["prop"] gives the specified property of a mail item.
  • Basic mail elements that can be found in a mail item:
  • "Flags"flags set for this message
    "Tags"user-defined tags set for this message
    "Folder"folder containing this message
    "OriginatingDate"date and time from message headers
    "OriginatingTimeZone"time zone from message headers
    "From"sender name and email address
    "FromAddress"sender raw email address
    "Subject"the subject of the email
    "BodyPreview"list of short previews of message bodies
    "ToList"recipient names and addresses
    "ToAddressList"recipient addresses
    "ToNameList"recipient full names
    "CcList"copied recipient names and addresses
    "CcAddressList"copied recipient addresses
    "CcNameList"copied recipient full names
    "BccList"blind-copied recipients (for Sent folder only)
    "MessageID"unique ID for this message
    "MessagePosition"position of the message within the mail folder
    "MessageSummary"association giving basic elements of the message
    "Body"message body as a string
    "AttachmentList"list of processed attachments as expressions
  • Additional advanced properties of MailItem include all elements available through "EML" import.

Examples

Basic Examples  (1)

Connect to a mail server:

Get the mail folder named "INBOX" from the mail server:

Get the last message:

Introduced in 2018
 (11.3)