InboundEmail Class

Represents an inbound email object.

Messaging

The following are constructors for InboundEmail.

  • InboundEmail()

    Creates a new instance of the Messaging.InboundEmail class.

Creates a new instance of the Messaging.InboundEmail class.

public InboundEmail()

The following are properties for InboundEmail.

  • authenticationResults

    A list of authentication results received with the email, if any.

  • binaryAttachments

    A list of binary attachments received with the email, if any.

  • ccAddresses

    A list of carbon copy (CC) addresses, if any.

  • fromAddress

    The email address that appears in the From field.

  • fromName

    The name that appears in the From field, if any.

  • headers

    A list of the RFC 2822 headers in the email.

  • htmlBody

    The HTML version of the email, if specified by the sender.

  • htmlBodyIsTruncated

    Indicates whether the HTML body text is truncated (true) or not (false.)

  • inReplyTo

    The In-Reply-To field of the incoming email. Identifies the email or emails to which this one is a reply (parent emails). Contains the parent email or emails’ message-IDs.

  • messageId

    The Message-ID—the incoming email’s unique identifier.

  • plainTextBody

    The plain text version of the email, if specified by the sender.

  • plainTextBodyIsTruncated

    Indicates whether the plain body text is truncated (true) or not (false.)

  • references

    The References field of the incoming email. Identifies an email thread. Contains a list of the parent emails’ References and message IDs, and possibly the In-Reply-To fields.

  • replyTo

    The email address that appears in the reply-to header.

  • subject

    The subject line of the email, if any.

  • textAttachments

    A list of text attachments received with the email, if any.

  • toAddresses

    The email address that appears in the To field.

A list of authentication results received with the email, if any.

public InboundEmail.AuthenticationResult[] authenticationResults {get; set;}

Type: InboundEmail.AuthenticationResult[]

Examples of authentication results include dkim, dmarc, and spf.

A list of binary attachments received with the email, if any.

public InboundEmail.BinaryAttachment[] binaryAttachments {get; set;}

Type: InboundEmail.BinaryAttachment[]

Examples of binary attachments include image, audio, application, and video files.

A list of carbon copy (CC) addresses, if any.

public String[] ccAddresses {get; set;}

Type: String[]

The email address that appears in the From field.

public String fromAddress {get; set;}

Type: String

The name that appears in the From field, if any.

public String fromName {get; set;}

Type: String

A list of the RFC 2822 headers in the email.

public InboundEmail.Header[] headers {get; set;}

Type: InboundEmail.Header[]

The list of the RFC 2822 headers includes:

  • Recieved from
  • Custom headers
  • Message-ID
  • Date

The HTML version of the email, if specified by the sender.

public String htmlBody {get; set;}

Type: String

Indicates whether the HTML body text is truncated (true) or not (false.)

public Boolean htmlBodyIsTruncated {get; set;}

Type: Boolean

The In-Reply-To field of the incoming email. Identifies the email or emails to which this one is a reply (parent emails). Contains the parent email or emails’ message-IDs.

public String inReplyTo {get; set;}

Type: String

The Message-ID—the incoming email’s unique identifier.

public String messageId {get; set;}

Type: String

The plain text version of the email, if specified by the sender.

public String plainTextBody {get; set;}

Type: String

Indicates whether the plain body text is truncated (true) or not (false.)

public Boolean plainTextBodyIsTruncated {get; set;}

Type: Boolean

The References field of the incoming email. Identifies an email thread. Contains a list of the parent emails’ References and message IDs, and possibly the In-Reply-To fields.

public String[] references {get; set;}

Type: String[]

The email address that appears in the reply-to header.

public String replyTo {get; set;}

Type: String

If there is no reply-to header, this field is identical to the fromAddress field.

The subject line of the email, if any.

public String subject {get; set;}

Type: String

A list of text attachments received with the email, if any.

public InboundEmail.TextAttachment[] textAttachments {get; set;}

Type: InboundEmail.TextAttachment[]

The text attachments can be any of the following:

  • Attachments with a Multipurpose Internet Mail Extension (MIME) type of text
  • Attachments with a MIME type of application/octet-stream and a file name that ends with either a .vcf or .vcs extension. These are saved as text/x-vcard and text/calendar MIME types, respectively.

The email address that appears in the To field.

public String[] toAddresses {get; set;}

Type: String[]