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:

Wolfram Research (2018), MailItem, Wolfram Language function, https://reference.wolfram.com/language/ref/MailItem.html.

Text

Wolfram Research (2018), MailItem, Wolfram Language function, https://reference.wolfram.com/language/ref/MailItem.html.

CMS

Wolfram Language. 2018. "MailItem." Wolfram Language & System Documentation Center. Wolfram Research. https://reference.wolfram.com/language/ref/MailItem.html.

APA

Wolfram Language. (2018). MailItem. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/MailItem.html

BibTeX

@misc{reference.wolfram_2023_mailitem, author="Wolfram Research", title="{MailItem}", year="2018", howpublished="\url{https://reference.wolfram.com/language/ref/MailItem.html}", note=[Accessed: 19-April-2024 ]}

BibLaTeX

@online{reference.wolfram_2023_mailitem, organization={Wolfram Research}, title={MailItem}, year={2018}, url={https://reference.wolfram.com/language/ref/MailItem.html}, note=[Accessed: 19-April-2024 ]}