# Custom SMTP

You can trial the Openfort platform by sending up to **3** emails per hour via the built-in service. The default email service is offered on a best effort basis: we will do our best to maintain it and will review usage of the service on a regular basis to see if the email service should be continued.

As you progress toward production, you may find yourself wanting a custom SMTP service to increase your limits. A custom SMTP server allows you to set your own cap on the number of emails sent per hour.

Beyond rate limits, an SMTP server might also help with:

* Deliverability and reputation management
* Scalability
* Analytics and tracking
* Compliance and anti-spam measures

## How to set up SMTP

Go to **Settings** > **Configuration** > **Auth** and click **Enable Custom SMTP** under the SMTP Provider section.

Fill in the fields below with the relevant details obtained from your custom SMTP provider:

<div align="center">
  <img width="100%" height="100%" src="https://www.openfort.io/images/blog/SMPT_setting_509fec2568.png" alt="Custom SMTP configuration form showing host, port, and authentication fields" />
</div>

### SMTP providers

You can use Openfort Auth with any major SMTP provider of your choosing. Some SMTP providers you could consider using are:

* [Twilio SendGrid](https://docs.sendgrid.com/for-developers/sending-email/integrating-with-the-smtp-api)
* [AWS SES](https://docs.aws.amazon.com/ses/latest/dg/send-email-smtp.html)

## Email templates

You can customize the email messages used for the authentication flows. You can edit the following email templates:

* Confirm signup
* Reset password

<div align="center">
  <img width="100%" height="100%" src="https://www.openfort.io/images/blog/email_templates_85f06db035.png" alt="Email template editor showing subject and body fields" />
</div>

## Terminology

The templating system provides the following variables for use:

| Name                     | Description                                                                                                                                                                                                                                                                           |
| ------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `{{ .state }}`           | Contains a 6-digit one-time password (OTP).                                                                                                 |
| `{{ .email }}`           | The user's email address.                                                                                |
| `{{ .redirectUrl }}`     | Contains the redirect URL to confirm the email address to a new account. |

## Editing email templates

Edit your email templates on the **Email Templates** page. Below is an example for a verification of a sign up:

```text
Subject: Confirm Reauthentication

Body:
<h2>Confirm reauthentication</h2>
    <p>Enter the code: {{ .state }}</p>
```
