Configure the Gitea mailer over SMTP

Gitea sends account confirmations, password resets and issue or pull request notifications through the `[mailer]` section of `app.ini`. Set `PROTOCOL` yourself: left empty, Gitea guesses from the port and treats anything other than 25, 465 or 587 (such as 2587) as `smtps`. Set `FROM` too: it defaults to `USER`, and with `USER = unitpost` Gitea refuses to start with `Invalid mailer.FROM (unitpost)`.

Need an API key?

SMTP password is a Unitpost API key with emails:send. Username is always unitpost.

  • 5,000 emails/month
  • 3 API keys
  • 5 sending domains
Get free SMTP key
  1. Create a send-only key

    In Unitpost, open Settings → SMTP and create a send-only key. FROM must be an address on a verified domain.

  2. Edit app.ini

    Gitea only sends credentials over TLS, so use smtp+starttls on 587 or smtps on 465.

    ini
    [mailer]
    ENABLED = true
    PROTOCOL = smtp+starttls
    SMTP_ADDR = smtp.unitpost.com
    SMTP_PORT = 587
    USER = unitpost
    PASSWD = pk_live_...
    FROM = gitea@yourdomain.com

    For port 465, set PROTOCOL = smtps and SMTP_PORT = 465. Gitea's docs recommend implicit TLS where the server supports it.

  3. Restart Gitea

    Gitea reads app.ini at startup, so restart the service or container after editing it.

  4. Send a testing email

    Sign in as an admin and open Site Administration → Configuration → Summary. Under Mailer Configuration, enter your address next to Send Testing Email and click Send.

  5. If it fails

    unable to infer unspecified mailer.PROTOCOL in the log means PROTOCOL is empty on a nonstandard port. 535 5.7.8 means USER isn't unitpost. 550 5.7.1 means FROM isn't on a verified domain.

Search docs and guides

Search the docs and product guides.