> For the complete documentation index, see [llms.txt](https://docs.authgear.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.authgear.com/customization/custom-email-provider.md).

# Custom Email Provider

Optimize for email deliverability by using your own SMTP server to send Authgear Emails (such as forgot password, verifications) in your own domains.

To send Authgear emails to end-users with your own domain, e.g. `support@myapp.com`. You will need to configure the external SMTP provider.

Authgear currently supports **SendGrid** and other custom SMTP Providers.

## Send from an email address under your domain

The sender address can be configured by changing the value of the`email.default.sender` key in the localization JSON. Go to **Portal** > **Branding** > **Custom Text** and add/change the value of `email.default.sender` to your own email address, for example `no-replay@myapp.com`, and **Save** the settings. The value can be set separately for each locale.

<figure><img src="https://2638622528-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MAjXpMovvVxeIY33s_K%2Fuploads%2Fgit-blob-cdaa40f93de53db2a4c28679d60580e26f9bfd11%2Fauthgear-default-sender-fix1.png?alt=media" alt=""><figcaption></figcaption></figure>

## Sender domain authentication

Before adding the email service provider to Authgear, make sure the sender domain is verified and authenticated on the email service. For example, your domain `myapp.com` should be configured in your SendGrid account so Authgear can use the account to send emails with `no-reply@myapp.com`.

Follow the instructions from the email service provider for setting up your domain:

* [How to set up domain authentication on SendGrid](https://docs.sendgrid.com/ui/account-and-settings/how-to-set-up-domain-authentication)

## Configure the external SMTP provider

The external SMTP provider can be set up in **Portal** > **Advanced** > **Custom Email Provider**. Enable the **Use my own provider** toggle to see the fields.

### Use SendGrid as external SMTP provider

1. Log in to your SendGrid account
2. Create API Key in **Settings** > **API Keys**
3. Set the **API Key Name** for your reference the choose **Restricted Access** under **API Key Permissions**
4. Under **Access Details,** expand **Mail Send** and give **Full Access** to the **Mail Send** permission
5. Click **Create & View.** Copy the API key created and save it somewhere safe
6. In Authgear **Portal**, navigate to **Custom Email Provider**
7. Enable **Use my own provider**.
8. Choose **SendGrid** and paste the API key you copied, and **Save**
9. You can send a test email to check the configuration

![](https://2638622528-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MAjXpMovvVxeIY33s_K%2Fuploads%2Fgit-blob-dba0204bc5ea34347c32c4a89092b5623d7d662c%2Fsmtp-sendgrid.png?alt=media)

### Using other SMTP Providers

Other SMTP providers can be set manually by providing the **Host**, **Port**, **Username**, and **Password**. They can be obtained from the documentation or instructions from your email service provider.

![](https://2638622528-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MAjXpMovvVxeIY33s_K%2Fuploads%2Fgit-blob-d889d6616deff07abb07a30cb9b69c480ee1bb80%2Fsmtp-manual.png?alt=media)


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.authgear.com/customization/custom-email-provider.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
