---
schema_version: "1"
id: 5b5bff097df2614ee0c83d1a52c1eec91470db74b85a5bd3f389f3c698b6eb4e
title: ConnectApi.EmailMessage
collection: legacydeveloper
version: current
locale: en-us
portal_url: https://docs.salesforce.com/legacydeveloper/current/en-us/apexref/apex_connectapi_output_emailMessage.md
canonical_url: https://developer.salesforce.com/docs/atlas.en-us.apexref.meta/apexref/apex_connectapi_output_emailMessage.htm
source_site: developer.salesforce.com
content_type: documentation
content_hash: b87198f6da62e801fa18b9211c3bf5dbf513232ca5a67864c9a21b9d27a68b52
description: Email message from a case.
---
# ConnectApi.EmailMessage

Email message from a case.

![Important](https://developer.salesforce.com/docs/atlas.en-us.apexref.meta/apexref/images/icon_note_important.png)

#### Important

This class isn’t available in version 32.0 and later. In version 32.0 and later, [ConnectApi.EmailMessageCapability](https://developer.salesforce.com/docs/atlas.en-us.apexref.meta/apexref/apex_connectapi_output_email_message_capability.htm "If a feed element has this capability, it has an email message from a case.") is used.

Subclass of [ConnectApi.FeedItemAttachment](https://developer.salesforce.com/docs/atlas.en-us.apexref.meta/apexref/apex_connectapi_output_feed_item_attachment.htm "Feed item attachment.").

<table class="featureTable sort_table" summary="">




          <thead class="thead sorted" align="left">
            <tr>
              <th class="featureTableHeader vertical-align-top " id="d961895e68">Name</th>

              <th class="featureTableHeader vertical-align-top " id="d961895e71">Type</th>

              <th class="featureTableHeader vertical-align-top " id="d961895e74">Description</th>

              <th class="featureTableHeader vertical-align-top " id="d961895e77">Available Version</th>

            </tr>

          </thead>

          <tbody class="tbody">
            <tr>
              <td class="entry" headers="d961895e68" data-title="Name"><samp class="codeph apex_code">direction</samp></td>

              <td class="entry" headers="d961895e71" data-title="Type">
                <samp class="codeph apex_code">ConnectApi.Email​MessageDirection</samp> Enum
              </td>

              <td class="entry" headers="d961895e74" data-title="Description">The direction of the email message.<ul class="ul bulletList">
                  <li class="li">
                    <samp class="codeph apex_code">Inbound</samp>—An inbound message (sent by a customer).
                  </li>
                  <li class="li">
                    <samp class="codeph apex_code">Outbound</samp>—An outbound message (sent to a customer by a support agent).
                  </li>
                </ul>
              </td>

              <td class="entry" headers="d961895e77" data-title="Available Version">29.0–31.0</td>

            </tr>

            <tr>
              <td class="entry" headers="d961895e68" data-title="Name"><samp class="codeph apex_code">emailMessageId</samp></td>

              <td class="entry" headers="d961895e71" data-title="Type">String</td>

              <td class="entry" headers="d961895e74" data-title="Description">The ID of the email message.</td>

              <td class="entry" headers="d961895e77" data-title="Available Version">29.0–31.0</td>

            </tr>

            <tr>
              <td class="entry" headers="d961895e68" data-title="Name"><samp class="codeph apex_code">subject</samp></td>

              <td class="entry" headers="d961895e71" data-title="Type">String</td>

              <td class="entry" headers="d961895e74" data-title="Description">The subject of the email message.</td>

              <td class="entry" headers="d961895e77" data-title="Available Version">29.0–31.0</td>

            </tr>

            <tr>
              <td class="entry" headers="d961895e68" data-title="Name"><samp class="codeph apex_code">textBody</samp></td>

              <td class="entry" headers="d961895e71" data-title="Type">String</td>

              <td class="entry" headers="d961895e74" data-title="Description">The body of the email message.</td>

              <td class="entry" headers="d961895e77" data-title="Available Version">29.0–31.0</td>

            </tr>

            <tr>
              <td class="entry" headers="d961895e68" data-title="Name"><samp class="codeph apex_code">toAddresses</samp></td>

              <td class="entry" headers="d961895e71" data-title="Type">
                <a class="xref" href="https://developer.salesforce.com/docs/atlas.en-us.apexref.meta/apexref/apex_methods_system_list.htm#apex_methods_system_list" title="Contains methods for the List collection type.">List</a>&lt;<a class="xref" href="https://developer.salesforce.com/docs/atlas.en-us.apexref.meta/apexref/apex_connectapi_output_emailAddress.htm#apex_connectapi_output_emailAddress" title="Email address."><samp class="codeph apex_code">ConnectApi.EmailAddress</samp></a>&gt;
              </td>

              <td class="entry" headers="d961895e74" data-title="Description">A list of email addresses to send the message to.</td>

              <td class="entry" headers="d961895e77" data-title="Available Version">29.0–31.0</td>

            </tr>

          </tbody>

        </table>