# SMTP Server

Configure email delivery for tenant invites and Hatchet alerts using any standard SMTP provider (Gmail, SendGrid, AWS SES, etc).

## Prerequisites

- An SMTP provider that supports [PLAIN](https://datatracker.ietf.org/doc/html/rfc4616/) authentication with a username and password.

## Configuration

Set the following environment variables:

```bash
# Enable SMTP
export SERVER_EMAIL_KIND=smtp
export SERVER_EMAIL_SMTP_ENABLED=true

# Connection Settings
export SERVER_EMAIL_SMTP_SERVER_ADDR=smtp.gmail.com:587            # Host and port
export SERVER_EMAIL_SMTP_AUTH_USERNAME=your-email@yourdomain.com   # Username or API Key ID
export SERVER_EMAIL_SMTP_AUTH_PASSWORD=your-password               # Password or API Secret Key

# Sender Identity
export SERVER_EMAIL_SMTP_FROM_EMAIL=noreply@yourdomain.com         # Sender email address
export SERVER_EMAIL_SMTP_SUPPORT_EMAIL=support@yourdomain.com      # Support contact email
export SERVER_EMAIL_SMTP_FROM_NAME="Hatchet"                       # (Optional) Display name
```

## Provider Reference

Common configuration values for major providers:

Provider, Server Address, Username, Password

**[Gmail](https://support.google.com/mail/answer/185833?hl=en)**, `smtp.gmail.com:587`, Your Email, [App Password](https://myaccount.google.com/apppasswords)
**[SendGrid](https://docs.sendgrid.com/for-developers/sending-email/integrating-with-the-smtp-api)**, `smtp.sendgrid.net:587`, `apikey`, Your API Key
**[AWS SES](https://docs.aws.amazon.com/ses/latest/dg/send-email-smtp.html)**, `email-smtp.us-east-1.amazonaws.com:587`, IAM Username, IAM Secret
**[Outlook](https://support.microsoft.com/en-us/office/pop-imap-and-smtp-settings-8361e398-8af4-4e97-b147-6c6c4ac95353)**, `smtp.office365.com:587`, Your Email, Your Password

> **Info:** To request another provider or SMTP authentication protocol, open a feature
>   request on
>   [GitHub](https://github.com/hatchet-dev/hatchet/issues/new?template=feature_request.md).
