---
schema_version: "1"
id: ef93b8affac720166aa1d34ea00d9f09cba8d4d0889f04e3e3dedf9c979dea79
title: EmailRelay
collection: legacydeveloper
version: current
locale: en-us
portal_url: https://docs.salesforce.com/legacydeveloper/current/en-us/object_reference/sforce_api_objects_emailrelay.md
canonical_url: https://developer.salesforce.com/docs/atlas.en-us.object_reference.meta/object_reference/sforce_api_objects_emailrelay.htm
source_site: developer.salesforce.com
content_type: documentation
content_hash: 35f27ea4d3ce7b068321ef33d8ae3aec06973cfe5bac91aacec084933556e228
description: Represents the configuration for sending an email relay. An email relay routes email sent from Salesforce through your company’s email servers. This object is available in API version 43.0 and later.
---
# EmailRelay

Represents the configuration for sending an email relay. An email relay routes email sent from Salesforce through your company’s email servers. This object is available in API version 43.0 and later.

## Supported Calls

create(), delete(), describeSObjects(), query(), retrieve(), update(), upsert()

## Special Access Rules

You must have the Email Administration, Customize Application, and View Setup user permissions to use this object.

## Fields

| Field Name | Details |
| --- | --- |
| AuthType | 
Type

picklist

Properties

Create, Filter, Group, Restricted Picklist, Sort, Update

Description

Specifies which SASL mechanism Salesforce uses for SMTP authentication. This field is available when Enable SMTP Auth is selected. Select an option:

- PLAIN- Salesforce uses PLAIN SASL mechanism for SMTP authentication. Default.
- LOGIN- Salesforce uses LOGIN SASL mechanism for SMTP authentication

This field is available in API version 52.0 and later.





 |
| Host | 

Type

string

Properties

Create, Filter, Group, idLookup, Sort, Update

Description

Indicates the host name or IP address of your company's SMTP server.





 |
| IsRequireAuth | 

Type

boolean

Properties

Create, Defaulted on create, Filter, Group, Sort, Update

Description

Indicates whether (true) or not (false) authentication is required. When setting this field to true, the TlsSetting must be set to **RequiredVerify**. This field is available in API version 44.0 and later.





 |
| Password | 

Type

encryptedstring

Properties

Create, Nillable, Update

Description

Specifies the password for relay host STMP authentication. When IsRequireAuth is set to true, this field is required. This field is available in API version 44.0 and later.





 |
| Port | 

Type

picklist

Properties

Create, Filter, Group, Restricted picklist, Sort, Update

Description

Indicates the port number of your company's SMTP server.

- 25
- 587
- 10025
- 11025





 |
| TlsSetting | 

Type

picklist

Properties

Create, Filter, Group, Restricted picklist, Sort, Update

Description

Specifies whether Salesforce uses TLS for SMTP sessions.

- Off: TLS is turned off. SMTP session continues through an insecure connection.
- Preferred: If the remote server supports TLS, Salesforce upgrades the current SMTP session to use TLS. If TLS is unavailable, Salesforce continues the session without TLS.
- Required: Salesforce continues the session only if the remote server supports TLS. If TLS is unavailable, Salesforce terminates the session without delivering the email.
- PreferredVerify: If the remote server supports TLS, Salesforce upgrades the current SMTP session to use TLS. Before the session begins, Salesforce verifies that the certificate is signed by a valid certificate authority, and that the common name presented in the certificate matches the domain or mail exchange of the current connection. If TLS is available but the certificate is not signed or the common name does not match, Salesforce disconnects the session and does not deliver the email. If TLS is unavailable, Salesforce continues the session without TLS.
- RequiredVerify: Salesforce continues the session only if the remote server supports TLS, the certificate is signed by a valid certificate authority, and the common name presented in the certificate matches the domain or mail exchange to which Salesforce is connected. If any of these criteria are not met, Salesforce terminates the session without delivering the email.





 |
| Username | 

Type

string

Properties

Create, Filter, Group, Nillable, Sort, Update

Description

Specifies the username for relay host STMP authentication. When IsRequireAuth is set to true, this field is required. This field is available in API version 44.0 and later.





 |

## Usage

An email relay must be associated with an active email domain filter to take effect. If you set up multiple email relays in one org, they are processed in the priority order of their email domain filters.

![Tip](https://developer.salesforce.com/docs/atlas.en-us.object_reference.meta/object_reference/images/icon_note_tip.png)

#### Tip

If you also plan to activate Bounce Management and Email Compliance Management, confirm with your email admin that your company allows relaying email sent from Salesforce. For more information on bounce management, see [Configure Deliverability Settings for Emails Sent from Salesforce](https://help.salesforce.com/articleView?id=emailadmin_send_through_salesforce_configure_deliverability.htm&language=en_US "HTML (New Window)").

#### See Also

- [EmailServicesFunction](https://developer.salesforce.com/docs/atlas.en-us.object_reference.meta/object_reference/sforce_api_objects_emailservicesfunction.htm "An email service.")
- [EmailDomainFilter](https://developer.salesforce.com/docs/atlas.en-us.object_reference.meta/object_reference/sforce_api_objects_emaildomainfilter.htm "Represents a filter that determines whether an email relay is restricted to a specific list of domains. This object is available in API version 43.0 and later.")