---
schema_version: "1"
id: cae6927ff8179abcc6ed859e80fca0621efce11dbefb36ff65acc16676f8e5b4
title: EmailMessages Methods
collection: legacydeveloper
version: current
locale: en-us
portal_url: https://docs.salesforce.com/legacydeveloper/current/en-us/apexref/apex_System_EmailMessages_methods.md
canonical_url: https://developer.salesforce.com/docs/atlas.en-us.apexref.meta/apexref/apex_System_EmailMessages_methods.htm
source_site: developer.salesforce.com
content_type: documentation
content_hash: 5a5e185c29443b9ef08ecbe82cfe8c93856c46643c7e899ea5d1b91139eaffd0
---
# EmailMessages Methods

The following are static methods for EmailMessages.

- **[getFormattedThreadingToken(recordId)](https://developer.salesforce.com/docs/atlas.en-us.apexref.meta/apexref/apex_System_EmailMessages_getFormattedThreadingToken.htm)**  
    Returns an email threading token that’s formatted with the correct prefix and suffix. This token can be embedded in an outbound email body, email subject, or both the body and subject. When users reply to the email, threading tokens can be used to attach responses to a record, such as a Case record in Email-to-Case.
- **[getRecordIdFromEmail(subject, textBody, htmlBody)](https://developer.salesforce.com/docs/atlas.en-us.apexref.meta/apexref/apex_System_EmailMessages_getRecordIdFromEmail.htm)**  
    Returns the record ID corresponding to the specified email threading token, or returns null if none is found.