---
schema_version: "1"
id: d24bc416dafe13b02313309d91f6b18a203d7069bc95f875d6f349f5875c88d5
title: The InboundEmail Object
collection: admin
version: current
locale: en-us
portal_url: https://docs.salesforce.com/admin/current/en-us/platform/264-0-0/code_inbound_email.md
canonical_url: https://help.salesforce.com/s/articleView?id=platform.code_inbound_email.htm&release=264.0.0&type=5
source_site: help.salesforce.com
content_type: documentation
content_hash: 35923db433b012e92c0f97412b96581182d8099c93458aac6eaa298ebd82771c
description: For every email the Apex email service domain receives, Salesforce creates a separate InboundEmail object that contains the contents and attachments of that email. You can use Apex classes that implement the Messaging.InboundEmailHandler interface to handle an inbound email message. Using the handleInboundEmail method in that class, you can access an InboundEmail object to retrieve the contents, headers, and attachments of inbound email messages, as well as perform many functions.
products:
  - Salesforce Platform
release: "264"
---
# The InboundEmail Object

For every email the Apex email service domain receives, Salesforce creates a separate InboundEmail object that contains the contents and attachments of that email. You can use Apex classes that implement the `Messaging.InboundEmailHandler` interface to handle an inbound email message. Using the `handleInboundEmail` method in that class, you can access an InboundEmail object to retrieve the contents, headers, and attachments of inbound email messages, as well as perform many functions.

### Required Editions

<table class="slds-table slds-table_bordered slds-max-medium-table_stacked slds-m-bottom_small edition"><colgroup><col style="width:100%"></colgroup><tbody><tr class=""><td class="slds-cell-wrap" style="vertical-align:top;">Available in: Salesforce Classic (<a href="https://help.salesforce.com/s/articleView?id=xcloud.overview_edition_lex_only.htm&amp;type=5&amp;language=en_US" target="_blank">not available in all orgs</a>)</td></tr><tr class=""><td class="slds-cell-wrap" style="vertical-align:top;">Available in: <strong>Enterprise</strong>, <strong>Performance</strong>, <strong>Unlimited</strong>, and <strong>Developer</strong> Editions</td></tr></tbody></table>

![Note](https://sf-zdocs-cdn-prod.zoominsoftware.com/tdta-platform-extend_code-264-0-0-production-enus/789bc523-706b-4ae4-8fe9-be6322e38b6b/images/icon_note.png)

Note For information on the Apex email service, see [Email Services](https://help.salesforce.com/s/articleView?id=platform.code_email_services.htm&release=264.0.0&type=5 "You can use email services to process the contents, headers, and attachments of inbound email. For example, you can create an email service that automatically creates contact records based on contact information in messages.").

## Example 1: Create Tasks for Contacts

The following is an example of how you can look up a contact based on the inbound email address and create a new task.

```java
public with sharing class CreateTaskEmailExample implements Messaging.InboundEmailHandler {
 
  public Messaging.InboundEmailResult handleInboundEmail(Messaging.inboundEmail email, 
                                                       Messaging.InboundEnvelope env){
 
    // Create an InboundEmailResult object for returning the result of the 
    // Apex Email Service
    Messaging.InboundEmailResult result = new Messaging.InboundEmailResult();
  
    String myPlainText= '';
    
    // Add the email plain text into the local variable 
    myPlainText = email.plainTextBody;
   
    // New Task object to be created
    Task[] newTask = new Task[0];
   
    // Try to look up any contacts based on the email from address
    // If there is more than one contact with the same email address,
    // an exception will be thrown and the catch statement will be called.
    try {
      Contact vCon = [SELECT Id, Name, Email
        FROM Contact
        WHERE Email = :email.fromAddress
        WITH USER_MODE
        LIMIT 1 ];
      
      // Add a new Task to the contact record we just found above.
      newTask.add(new Task(Description =  myPlainText,
           Priority = 'Normal',
           Status = 'Inbound Email',
           Subject = email.subject,
           IsReminderSet = true,
           ReminderDateTime = System.now()+1,
           WhoId =  vCon.Id));
     
     // Insert the new Task 
     insert as user newTask;    
     
     System.debug('New Task Object: ' + newTask );   
    }
    // If an exception occurs when the query accesses 
    // the contact record, a QueryException is called.
    // The exception is written to the Apex debug log.
   catch (QueryException e) {
       System.debug('Query Issue: ' + e);
   }
   
   // Set the result to true. No need to send an email back to the user 
   // with an error message
   result.success = true;
   
   // Return the result for the Apex Email Service
   return result;
  }
}
```

## Example 2: Handle Unsubscribe Email

Companies that send marketing email to their customers and prospects need to provide a way to let the recipients unsubscribe. The following is an example of how an email service can process unsubscribe requests. The code searches the subject line of inbound email for the word “unsubscribe.” If the word is found, the code finds all contacts and leads that match the From email address and sets the Email Opt Out field (`HasOptedOutOfEmail`) to True.

```java
public with sharing class unsubscribe implements Messaging.inboundEmailHandler{

    public Messaging.InboundEmailResult handleInboundEmail(Messaging.InboundEmail email, 
                         Messaging.InboundEnvelope env ) {
    
        // Create an inboundEmailResult object for returning 
        // the result of the email service.
        Messaging.InboundEmailResult result = new Messaging.InboundEmailResult();
         
        // Create contact and lead lists to hold all the updated records.
        List<Contact> lc = new List <contact>();
        List<Lead> ll = new List <lead>();
         
        // Convert the subject line to lower case so the program can match on lower case.
        String mySubject = email.subject.toLowerCase();
        // The search string used in the subject line.
        String s = 'unsubscribe';
         
        // Check the variable to see if the word "unsubscribe" was found in the subject line. 
        Boolean unsubMe;
        // Look for the word "unsubcribe" in the subject line. 
        // If it is found, return true; otherwise, return false.
        unsubMe = mySubject.contains(s);
         
         // If unsubscribe is found in the subject line, enter the IF statement.
         
        if (unsubMe == true) {
            
            try {
               
            // Look up all contacts with a matching email address.
               
            for (Contact c : [SELECT Id, Name, Email, HasOptedOutOfEmail
                          FROM Contact
                          WHERE Email = :env.fromAddress
                          AND hasOptedOutOfEmail = false
                          LIMIT 100]) {
                          
                // Add all the matching contacts into the list.   
                c.hasOptedOutOfEmail = true;
                lc.add(c);
            }
            // Update all of the contact records.
            update as user lc;
        }
        catch (System.QueryException e) {
            System.debug('Contact Query Issue: ' + e);
        }   
        
        try {
            // Look up all leads matching the email address.
            for (Lead l : [SELECT Id, Name, Email, HasOptedOutOfEmail
                     FROM Lead
                     WHERE Email = :env.fromAddress
                     AND isConverted = false
                     AND hasOptedOutOfEmail = false
                     LIMIT 100]) {
                // Add all the leads to the list.       
                l.hasOptedOutOfEmail = true;
                ll.add(l);
                   
                System.debug('Lead Object: ' + l);   
            } 
            // Update all lead records in the query.
            update as user ll;
        }
        
        catch (System.QueryException e) {
            System.debug('Lead Query Issue: ' + e);
        }   
        
        System.debug('Found the unsubscribe word in the subject line.');
         } 
         else {
            System.debug('No Unsuscribe word found in the subject line.' );
         }
        // Return True and exit.
        // True confirms program is complete and no emails 
        // should be sent to the sender of the unsubscribe request. 
        result.success = true;
        return result;
    }   
}
```

```java
@isTest
private class unsubscribeTest {
    // The following test methods provide adequate code coverage 
    // for the unsubscribe email class.
    // There are two methods, one that does the testing
    // with a valid "unsubcribe" in the subject line
    // and one the does not contain "unsubscribe" in the
    // subject line.        
    static testMethod void testUnsubscribe() {
    
       // Create a new email and envelope object.
       Messaging.InboundEmail email = new Messaging.InboundEmail() ;
       Messaging.InboundEnvelope env    = new Messaging.InboundEnvelope();
    
       // Create a new test lead and insert it in the test method.
       Lead l = new lead(firstName='John', 
                lastName='Smith',
                Company='Salesforce', 
                Email='user@acme.com', 
                HasOptedOutOfEmail=false);
       insert l;
    
       // Create a new test contact and insert it in the test method.
       Contact c = new Contact(firstName='john', 
                    lastName='smith', 
                    Email='user@acme.com', 
                    HasOptedOutOfEmail=false);
       insert c;
       
       // Test with the subject that matches the unsubscribe statement.
       email.subject = 'test unsubscribe test';
       env.fromAddress = 'user@acme.com';
       
       // Call the class and test it with the data in the testMethod.
       unsubscribe unsubscribeObj = new unsubscribe();
       unsubscribeObj.handleInboundEmail(email, env );
                            
    }
     
    static testMethod void testUnsubscribe2() {
    
       // Create a new email and envelope object.
       Messaging.InboundEmail email = new Messaging.InboundEmail();
       Messaging.InboundEnvelope env = new Messaging.InboundEnvelope();
    
       // Create a new test lead and insert it in the test method.        
       Lead l = new lead(firstName='john', 
                lastName='smith',
                Company='Salesforce', 
                Email='user@acme.com', 
                HasOptedOutOfEmail=false);
       insert l;
    
       // Create a new test contact and insert it in the test method.    
       Contact c = new Contact(firstName='john', 
                    lastName='smith', 
                    Email='user@acme.com', 
                    HasOptedOutOfEmail=false);
       insert c;
       
       // Test with a subject that does not contain "unsubscribe."
       email.subject = 'test';
       env.fromAddress = 'user@acme.com';
    
       // Call the class and test it with the data in the test method.
       unsubscribe unsubscribeObj = new unsubscribe();
       unsubscribeObj.handleInboundEmail(email, env );                      
    }     
}
```

## InboundEmail Object

An InboundEmail object has the following fields.

<table class="slds-table slds-table_bordered slds-max-medium-table_stacked slds-m-bottom_small ">
        <colgroup>
          <col style="width:26.54424040066778%">
          <col style="width:29.382303839732888%">
          <col style="width:44.073455759599334%">
        </colgroup>
        <thead class="slds-text-title_caps ">
          <tr class="">
            <th scope="col" class="slds-cell-wrap" style="vertical-align:top;" id="d20114e143">Name</th>
            <th scope="col" class="slds-cell-wrap" style="vertical-align:top;" id="d20114e146">Type</th>
            <th scope="col" class="slds-cell-wrap" style="vertical-align:top;" id="d20114e149">Description</th>
          </tr>
        </thead>
        <tbody>
          <tr class="">
            <td data-label="Name" class="slds-cell-wrap" style="vertical-align:top;" headers="d20114e143 ">
              <samp class="parmname">binaryAttachments</samp>
            </td>

            <td data-label="Type" class="slds-cell-wrap" style="vertical-align:top;" headers="d20114e146 ">InboundEmail.BinaryAttachment[]</td>

            <td data-label="Description" class="slds-cell-wrap" style="vertical-align:top;" headers="d20114e149 ">
              <p>A list of binary attachments received with the email, if any. </p>
              <p style="margin-bottom:0;" id="code_inbound_email__BinAttachmentsCanBe"><a name="code_inbound_email__BinAttachmentsCanBe"><!-- --></a>Examples of binary attachments include
                image, audio, application, and video files.</p>
            </td>

          </tr>
          <tr class="">
            <td data-label="Name" class="slds-cell-wrap" style="vertical-align:top;" headers="d20114e143 ">
              <samp class="parmname">ccAddresses</samp>
            </td>

            <td data-label="Type" class="slds-cell-wrap" style="vertical-align:top;" headers="d20114e146 ">String[]</td>

            <td data-label="Description" class="slds-cell-wrap" style="vertical-align:top;" headers="d20114e149 ">A list of carbon copy (CC) addresses, if any.</td>

          </tr>
          <tr class="">
            <td data-label="Name" class="slds-cell-wrap" style="vertical-align:top;" headers="d20114e143 ">
              <samp class="parmname">fromAddress</samp>
            </td>

            <td data-label="Type" class="slds-cell-wrap" style="vertical-align:top;" headers="d20114e146 ">String</td>

            <td data-label="Description" class="slds-cell-wrap" style="vertical-align:top;" headers="d20114e149 ">The email address that appears in the From field.</td>

          </tr>
          <tr class="">
            <td data-label="Name" class="slds-cell-wrap" style="vertical-align:top;" headers="d20114e143 ">
              <samp class="parmname">fromName</samp>
            </td>

            <td data-label="Type" class="slds-cell-wrap" style="vertical-align:top;" headers="d20114e146 ">String</td>

            <td data-label="Description" class="slds-cell-wrap" style="vertical-align:top;" headers="d20114e149 ">The name that appears in the From field, if any.</td>

          </tr>
          <tr class="">
            <td data-label="Name" class="slds-cell-wrap" style="vertical-align:top;" headers="d20114e143 ">
              <samp class="parmname">headers</samp>
            </td>

            <td data-label="Type" class="slds-cell-wrap" style="vertical-align:top;" headers="d20114e146 ">InboundEmail.Header[]</td>

            <td data-label="Description" class="slds-cell-wrap" style="vertical-align:top;" headers="d20114e149 ">
              <p>A list of the RFC 2822 headers in the email, including:</p>
              <ul>
                <li>Received from</li>
                <li>Custom headers</li>
                <li>Message-ID</li>
                <li>Date</li>
              </ul>
            </td>

          </tr>
          <tr class="">
            <td data-label="Name" class="slds-cell-wrap" style="vertical-align:top;" headers="d20114e143 ">
              <samp class="parmname">htmlBody</samp>
            </td>

            <td data-label="Type" class="slds-cell-wrap" style="vertical-align:top;" headers="d20114e146 ">String</td>

            <td data-label="Description" class="slds-cell-wrap" style="vertical-align:top;" headers="d20114e149 ">The HTML version of the email, if specified by the
              sender.</td>

          </tr>
          <tr class="">
            <td data-label="Name" class="slds-cell-wrap" style="vertical-align:top;" headers="d20114e143 ">
              <samp class="parmname" id="code_inbound_email__htmlbodyistruncated"><a name="code_inbound_email__htmlbodyistruncated"><!-- --></a>htmlBodyIsTruncated</samp>
            </td>

            <td data-label="Type" class="slds-cell-wrap" style="vertical-align:top;" headers="d20114e146 ">Boolean</td>

            <td data-label="Description" class="slds-cell-wrap" style="vertical-align:top;" headers="d20114e149 ">Indicates whether the HTML body text is truncated (<code>true</code>) or not (<code>false</code>.)</td>

          </tr>
          <tr class="">
            <td data-label="Name" class="slds-cell-wrap" style="vertical-align:top;" headers="d20114e143 ">
              <samp class="parmname" id="code_inbound_email__apex_inbound_inreplyto"><a name="code_inbound_email__apex_inbound_inreplyto"><!-- --></a>inReplyTo</samp>
            </td>

            <td data-label="Type" class="slds-cell-wrap" style="vertical-align:top;" headers="d20114e146 ">String</td>

            <td data-label="Description" class="slds-cell-wrap" style="vertical-align:top;" headers="d20114e149 ">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.</td>

          </tr>
          <tr class="">
            <td data-label="Name" class="slds-cell-wrap" style="vertical-align:top;" headers="d20114e143 ">
              <samp class="parmname" id="code_inbound_email__apex_inbound_messageid"><a name="code_inbound_email__apex_inbound_messageid"><!-- --></a>messageId</samp>
            </td>

            <td data-label="Type" class="slds-cell-wrap" style="vertical-align:top;" headers="d20114e146 ">String</td>

            <td data-label="Description" class="slds-cell-wrap" style="vertical-align:top;" headers="d20114e149 ">The Message-ID—the incoming email's unique
              identifier.</td>

          </tr>
          <tr class="">
            <td data-label="Name" class="slds-cell-wrap" style="vertical-align:top;" headers="d20114e143 ">
              <samp class="parmname">plainTextBody</samp>
            </td>

            <td data-label="Type" class="slds-cell-wrap" style="vertical-align:top;" headers="d20114e146 ">String</td>

            <td data-label="Description" class="slds-cell-wrap" style="vertical-align:top;" headers="d20114e149 ">The plain text version of the email, if specified by the
              sender.</td>

          </tr>
          <tr class="">
            <td data-label="Name" class="slds-cell-wrap" style="vertical-align:top;" headers="d20114e143 ">
              <samp class="parmname" id="code_inbound_email__plainTextBodyIsTruncated"><a name="code_inbound_email__plainTextBodyIsTruncated"><!-- --></a>plainTextBodyIsTruncated</samp>
            </td>

            <td data-label="Type" class="slds-cell-wrap" style="vertical-align:top;" headers="d20114e146 ">Boolean</td>

            <td data-label="Description" class="slds-cell-wrap" style="vertical-align:top;" headers="d20114e149 ">Indicates whether the plain body text is truncated (<code>true</code>) or not (<code>false</code>.)</td>

          </tr>
          <tr class="">
            <td data-label="Name" class="slds-cell-wrap" style="vertical-align:top;" headers="d20114e143 ">
              <samp class="parmname" id="code_inbound_email__apex_inbound_references"><a name="code_inbound_email__apex_inbound_references"><!-- --></a>references</samp>
            </td>

            <td data-label="Type" class="slds-cell-wrap" style="vertical-align:top;" headers="d20114e146 ">String []</td>

            <td data-label="Description" class="slds-cell-wrap" style="vertical-align:top;" headers="d20114e149 ">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. </td>

          </tr>
          <tr class="">
            <td data-label="Name" class="slds-cell-wrap" style="vertical-align:top;" headers="d20114e143 ">
              <samp class="parmname">replyTo</samp>
            </td>

            <td data-label="Type" class="slds-cell-wrap" style="vertical-align:top;" headers="d20114e146 ">String</td>

            <td data-label="Description" class="slds-cell-wrap" style="vertical-align:top;" headers="d20114e149 ">
              <p>The email address that appears in the reply-to header.</p>
              <p style="margin-bottom:0;">If there
                is no reply-to header, this field is identical to the
                <samp class="parmname">fromAddress</samp> field.
              </p>
            </td>

          </tr>
          <tr class="">
            <td data-label="Name" class="slds-cell-wrap" style="vertical-align:top;" headers="d20114e143 ">
              <samp class="parmname">subject</samp>
            </td>

            <td data-label="Type" class="slds-cell-wrap" style="vertical-align:top;" headers="d20114e146 ">String</td>

            <td data-label="Description" class="slds-cell-wrap" style="vertical-align:top;" headers="d20114e149 ">The subject line of the email, if any.</td>

          </tr>
          <tr class="">
            <td data-label="Name" class="slds-cell-wrap" style="vertical-align:top;" headers="d20114e143 ">
              <samp class="parmname">textAttachments</samp>
            </td>

            <td data-label="Type" class="slds-cell-wrap" style="vertical-align:top;" headers="d20114e146 ">InboundEmail.TextAttachment[]</td>

            <td data-label="Description" class="slds-cell-wrap" style="vertical-align:top;" headers="d20114e149 ">
              <p>A list of text attachments received with the email, if any.</p>
              <p>The
                text attachments can be any of the following:</p>
              <ul>
                <li>Attachments with a Multipurpose Internet Mail Extension
                  (MIME) type of <code>text</code></li>
                <li>Attachments with a MIME type of <code>application/octet-stream</code> and a file name that
                  ends with either a <samp class="filepath">.vcf</samp> or
                  <samp class="filepath">.vcs</samp> extension. These are saved as
                  <code>text/x-vcard</code> and
                  <code>text/calendar</code> MIME
                  types, respectively.
                </li>
              </ul>
            </td>

          </tr>
          <tr class="">
            <td data-label="Name" class="slds-cell-wrap" style="vertical-align:top;" headers="d20114e143 ">
              <samp class="parmname">toAddresses</samp>
            </td>

            <td data-label="Type" class="slds-cell-wrap" style="vertical-align:top;" headers="d20114e146 ">String[]</td>

            <td data-label="Description" class="slds-cell-wrap" style="vertical-align:top;" headers="d20114e149 ">The email address that appears in the <samp class="parmname">To</samp>
              field.</td>

          </tr>
        </tbody>
      </table>

## InboundEmail.Header Object

An InboundEmail object stores RFC 2822 email header information in an InboundEmail.Header object with the following fields.

  
| Name | Type | Description |
| --- | --- | --- |
| name | String | The name of the header parameter, such as `Date` or `Message-ID`. |
| value | String | The value of the header. |

## InboundEmail.BinaryAttachment Object

An InboundEmail object stores binary attachments in an InboundEmail.BinaryAttachment object.

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

An InboundEmail.BinaryAttachment object has the following fields.

  
| Name | Type | Description |
| --- | --- | --- |
| body | Blob | The body of the attachment. |
| fileName | String | The name of the attached file. |
| mimeTypeSubType | String | The primary and sub MIME-type. |

## InboundEmail.TextAttachment Object

An InboundEmail object stores text attachments in an InboundEmail.TextAttachment object.

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.

An InboundEmail.TextAttachment object has the following fields.

  
| Name | Type | Description |
| --- | --- | --- |
| body | String | The body of the attachment. |
| bodyIsTruncated | Boolean | Indicates whether the attachment body text is truncated (`true`) or not (`false`.) |
| charset | String | The original character set of the body field. The body is re-encoded as UTF-8 as input to the Apex method. |
| fileName | String | The name of the attached file. |
| mimeTypeSubType | String | The primary and sub MIME-type. |

## InboundEmailResult Object

The InboundEmailResult object is used to return the result of the email service. If this object is null, the result is assumed to be successful. The InboundEmailResult object has the following fields.

<table class="slds-table slds-table_bordered slds-max-medium-table_stacked slds-m-bottom_small ">
        <colgroup>
          <col style="width:23.36764705882353%">
          <col style="width:14.852941176470589%">
          <col style="width:61.779411764705884%">
        </colgroup>
        <thead class="slds-text-title_caps ">
          <tr class="">
            <th scope="col" class="slds-cell-wrap" style="vertical-align:top;" id="d20114e798">Name</th>
            <th scope="col" class="slds-cell-wrap" style="vertical-align:top;" id="d20114e801">Type</th>
            <th scope="col" class="slds-cell-wrap" style="vertical-align:top;" id="d20114e804">Description</th>
          </tr>
        </thead>
        <tbody>
          <tr class="">
            <td data-label="Name" class="slds-cell-wrap" style="vertical-align:top;" headers="d20114e798 ">
              <samp class="parmname">success</samp>
            </td>

            <td data-label="Type" class="slds-cell-wrap" style="vertical-align:top;" headers="d20114e801 ">Boolean</td>

            <td data-label="Description" class="slds-cell-wrap" style="vertical-align:top;" headers="d20114e804 ">
              <p>A value that indicates whether the email was successfully
                processed. </p>
              <p style="margin-bottom:0;">If <code>false</code>, <span id="code_inbound_email__ProdName"><a name="code_inbound_email__ProdName"><!-- --></a>Salesforce</span> rejects the inbound email and
                sends a reply email to the original sender containing the
                message specified in the <samp class="parmname">Message</samp>
                field.</p>
            </td>

          </tr>
          <tr class="">
            <td data-label="Name" class="slds-cell-wrap" style="vertical-align:top;" headers="d20114e798 ">
              <samp class="parmname">message</samp>
            </td>

            <td data-label="Type" class="slds-cell-wrap" style="vertical-align:top;" headers="d20114e801 ">String</td>

            <td data-label="Description" class="slds-cell-wrap" style="vertical-align:top;" headers="d20114e804 ">A message that Salesforce returns in the body of a reply email.
              This field can be populated with text irrespective of the value
              returned by the <samp class="parmname">Success</samp> field.</td>

          </tr>
        </tbody>
      </table>

## InboundEnvelope Object

The InboundEnvelope object stores the envelope information associated with the inbound email, and has the following fields.

  
| Name | Type | Description |
| --- | --- | --- |
| toAddress | String | The name that appears in the To field of the envelope, if any. |
| fromAddress | String | The name that appears in the From field of the envelope, if any. |

#### See Also

- [What Are Email Services?](https://help.salesforce.com/s/articleView?id=platform.code_email_services_overview.htm&release=264.0.0&type=5 "Email services are automated processes that use Apex classes to process inbound email.")
- [Define Email Service Addresses](https://help.salesforce.com/s/articleView?id=platform.code_email_service_address.htm&release=264.0.0&type=5 "Add an inbound email address for an email service.")
- [Define Email Services](https://help.salesforce.com/s/articleView?id=platform.code_email_services_editing.htm&release=264.0.0&type=5 "Set up an email service to handle incoming email, and configure the service to process messages according to your users' needs.")
- [Email Services](https://help.salesforce.com/s/articleView?id=platform.code_email_services.htm&release=264.0.0&type=5 "You can use email services to process the contents, headers, and attachments of inbound email. For example, you can create an email service that automatically creates contact records based on contact information in messages.")
- [Apex Code Overview](https://help.salesforce.com/s/articleView?id=platform.code_about.htm&release=264.0.0&type=5 "Apex is a strongly typed, object-oriented programming language that allows developers to execute flow and transaction control statements on the Salesforce Platform. Apex enables developers to add business logic to most system events, including button clicks, related record updates, and Visualforce pages. Apex code can be initiated by web service requests and from triggers on objects.")