Wolfram Language & System 11.0 (2016)|Legacy Documentation

This is documentation for an earlier version of the Wolfram Language.View current documentation (Version 11.2)

EML (.eml)

BackgroundBackground

    MIME type: message/rfc822
    Electronic mail message format.
    Used by most mail systems to save individual mail messages.
    Textual format, with encoded binary data.
    Supports Multipurpose Internet Mail Extensions (MIME).
    Supports RFC 2045, RFC 2046, RFC 2047, RFC 4288, RFC 4289, and RFC 2049.

Import and ExportImport and Export

  • Import["file.eml"] imports an EML file, returning an association giving basic elements of the corresponding mail message.
  • Import["file.eml",elem] imports the specified element from an EML file.
  • Import["file.eml",{{elem1,elem2,}}] imports multiple elements.
  • The import format can be specified with Import["file","EML"] or Import["file",{"EML",elem,}].
  • See Import for full general information.
  • ImportString supports the EML format.

ElementsElements

  • General Import elements:
  • "Elements" list of elements and options available in this file
    "Rules"full list of rules for each element and option
    "Options"list of rules for options, properties, and settings
  • Basic whole-message elements:
  • "MessageSummary"association giving basic elements of the message
    "MessageElements"association giving main elements of the message
    "FullMessageElements"association giving all elements of the message
  • Import by default gives the "MessageElements" element.
  • Basic elements from within the message:
  • "From"sender name and email address
    "FromAddress"sender raw email address
    "Subject"the subject of the email
    "Body"message body as a string
    "Attachments"list of processed attachments as expressions
    "AttachmentData"list of associations giving raw data on attachments
  • Additional sender and recipient elements:
  • "FromName"sender full name
    "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
    "ReturnPath"declared return path for the mail
    "ReplyToList"reply-to names and addresses
    "ReplyToAddressList"reply-to addresses
    "ReplyToNameList"reply-to full names
  • Message-body elements:
  • "NewBodyContent"parts of the body that are not replies or forwards
    "QuotedContent"parts of the body that are quoted
  • Attachment-related elements:
  • "AttachmentSummaries"list of associations giving basic attachment elements
    "Attachments"list of expressions giving the content of attachments
    "AttachmentNames"list of names assigned to attachments
    "AttachmentAssociations"associations giving content and metadata of attachments
  • Message-identification and threading elements:
  • "MessageID"message ID for this message
    "ReplyToMessageID"ID of a message to which this replies, if any
  • Message-routing-related elements:
  • "Precedence"declared mail precedence
    "ReturnReceiptRequested"whether a return receipt is requested
    "DeliveryChainHostnames"hostnames on the mail delivery chain
    "DeliveryChainRecords"full records on the mail delivery chain
  • Mail-header-related elements:
  • "HeaderString"complete email headers as a string
    "HeaderRules"list of rules for all headers
    "CharacterEncoding"character encoding for email content
    "ContentType"MIME content type of email body
  • Message-origination-related elements:
  • "OriginatingMailClient"type of originating mail client
    "OriginatingIPAddress"IP address of the originating client machine
    "OriginatingHostname"hostname of the originating client machine
    "OriginatingCountry"geo IP-inferred originating country
    "OriginatingDate"date and time on client from email headers
    "OriginatingTimezone"client time zone based on email headers
    "ServerOriginatingDate"date and time on originating server
    "ServerOriginatingTimezone"time zone of originating server
  • The setting for "AttachmentAssociations" is a list giving an association for each attachment. The elements of this association are typically as follows:
  • "Content"attachment content as an expression
    "Name"name assigned to the attachment
    "MIMEType"MIME type used to encode the content
    "RawContent"raw encoded content as a string
    "ByteCount"number of bytes in the raw encoded content
    "ModificationDate"modification date recorded for the attachment

ExamplesExamplesopen allclose all

Basic Examples  (4)Basic Examples  (4)

Import an electronic mail message:

In[1]:=
Click for copyable input
Out[1]=

Import a message summary for an EML file:

In[1]:=
Click for copyable input
Out[1]=

Import the message subject from an EML file:

In[1]:=
Click for copyable input
Out[1]=

Import the message date from an EML file:

In[1]:=
Click for copyable input
Out[1]=
Introduced in 2016
(11.0)