# Connect YouTrack to an Email Service

On the Global Settings page, you configure the connection between YouTrack and a mail server. This enables notifications in YouTrack over email.

> **Note: Enable email!**
> If your installation uses a built-in Hub service, the connected mail server also sends invitations to register an account, verification emails, and password recovery instructions. If email notifications are disabled or configured incorrectly, your users do not receive any of these messages.

![Server Settings Notifications page with SMTP connection fields.](https://resources.jetbrains.com.cn/help/img/youtrack/2026.2/smtp-settings.png)

## Special Requirements for Connecting to Gmail

To send YouTrack notifications using a Gmail account, you need to generate and use an application-specific password (App Password). The Google account that you use for authentication must have 2-Step Verification enabled. To connect to the Gmail service with this account, generate an application-specific password in your Google account.

* For the Username, enter the username for your Google account.

* For the Password, enter an application-specific password that you generated in Google.

To learn more about app passwords for Google accounts, please refer to the [Gmail Help](https://support.google.com/mail/answer/185833).

## Prerequisites for Sending Email With the Microsoft Graph API

Before you can enable email notifications using the Microsoft Graph API, you need to register an application in the Microsoft Entra ID platform and configure it to send email. Here's a general overview of the required steps:

1. Register a Microsoft Entra ID application.

* Create a new application in the Microsoft Entra ID Portal.

* Generate a client secret for the application.

* Note and securely store the Tenant ID, Client ID, and Client Secret. You will need to provide these values when setting up the connection.

2. Assign API permissions.

* Navigate to the API permissions section of your application.

* Add the `Mail.Send` permission as an Application permission (not Delegated).

* Grant admin consent for the permission to ensure it is active for the entire tenant.

3. Designate a user account for sending email. Ensure the user has:

* Full membership status (guest accounts are not supported).

* An active mailbox.

By completing these steps, you will have met the prerequisites for sending email notifications using the Microsoft Graph API. For detailed instructions, please refer to the official documentation for [Microsoft Graph](https://learn.microsoft.com/en-us/graph/overview).

## Enable Email Notifications Using an External Mail Service

To send email notifications from YouTrack, you need to establish a connection with an external email service. YouTrack supports multiple protocols for sending mail, including standard SMTP and Microsoft 365 via the Graph API. Depending on the selected protocol, different configuration settings and prerequisites apply. This section guides you through the steps required to enable email notifications and configure the connection to your preferred email service.

Procedure: To enable email notifications:

> **Tip:**
> Requires permissions: Low-level Admin Write

1. From the main navigation menu, select ![](https://resources.jetbrains.com.cn/help/img/youtrack/2026.2/settings.svg) `Administration > Server Settings > Global Settings`.

2. Select the Notifications tab.

3. Activate the Email notifications setting.

* The settings for connecting with an email server are displayed.

4. For the Mail protocol, select the protocol used to connect with your email server.

* If you select any one of the SMTP protocols, settings specific to that protocol are displayed. If you want to send email notifications using a Gmail account, there are special requirements you should bear in mind before you continue with this setup. For details, see [Special Requirements for Connecting to Gmail](#smtp-settings-gmail-server).

* If you select MS 365 Graph API, a different set of settings are shown. There are specific prerequisites required for sending mail using the Graph API. For details, see [Prerequisites for Sending Email With the Microsoft Graph API](#graph-api-prerequisites).

5. Enter values for the following settings:

> **Note:**
> The settings for this setup vary by protocol. To make sure you see instructions that are relevant to you, select the tab that corresponds with the protocol used to connect with your email server.

SMTP | SMTP + STARTTLS | SMTPS:

| Setting | Description |
| --- | --- |
| Server address | Enter the server address of your mail service. |
| Server port | Enter the connection port for the mail service. |
| Connect anonymously | If your mail server does not require authentication, enable this option.     When enabled, YouTrack connects to your mail service without sending a username and password. The input fields for SMTP username and SMTP password are disabled. Values that are stored in these settings are ignored.   |
| Username | Enter the username of the account that is used to access the mail server.     If you're connecting to Gmail, additional security requirements may apply. For details, see [Special Requirements for Connecting to Gmail](#smtp-settings-gmail-server).   |
| Password | Enter the password for the account that is used to access the mail service. |
| SSL key | Select a previously uploaded SSL key or trusted certificate for secure connection to your mail server. For details, see [SSL Keys](ssl-key-stores.html).     > **Note:** > To enable a secure connection to your mail service, you need to import its SSL certificate into YouTrack. For instructions, see [SSL Certificates](ssl-certificates.html).    |
| From address | Enter the address that you want to use to send email notifications. For more information about email addresses, see [From and Reply-to Addresses](email-from-addresses.html). |
| Reply-to address | Enter an optional address that you want to use for email replies. For more information about email addresses, see [From and Reply-to Addresses](email-from-addresses.html). |

MS 365 Graph API:

| Setting | Description |
| --- | --- |
| User email | Enter the email address of the user account designed to send email for your Microsoft Entra ID application.   |
| Tenant ID | Enter the Tenant ID assigned to your Microsoft Entra ID application. |
| Client ID | Enter the Client ID for your Microsoft Entra ID application. |
| Client secret | Enter the Client secret for your Microsoft Entra ID application. |
| Reply-to address | Enter an optional address that you want to use for email replies. For more information about email addresses, see [From and Reply-to Addresses](email-from-addresses.html). |

6. When finished, click the Save button.

7. Test the connection.

1. Click the Send test message button.

2. Enter an email address to which the test message should be sent.

![Sending a test message to a specified email address.](https://resources.jetbrains.com.cn/help/img/youtrack/2026.2/send-test-email.png)

3. Click the Send button.

8. Check the email account that you sent the test message to and verify that the message was delivered.

* If successful, the connection to your external mail service is configured and ready for use.

* If unsuccessful, update your settings and test the connection until the message delivery is successful.

## Migrating from YouTrack Cloud to YouTrack Server

When you set up a YouTrack Server installation using a database that was previously exported from YouTrack Cloud, the settings that connect to the mail service that is hosted by JetBrains are still present in the database. This often happens when a company uses our free plan or trial to test the application in the cloud, then later decides to switch to an on-premises installation.

To ensure the deliverability of email messages that are sent from our hosted email service, connections from outside our hosted infrastructure are periodically blocked. If you're not already using your own email notification service, you need to set it up and connect it to your YouTrack Server installation. Otherwise, the email messages that are routed to our hosted service will not be delivered.

