2019-10-16 17:04:20 +05:30
|
|
|
|
---
|
|
|
|
|
date: "2019-10-15T10:10:00+05:00"
|
|
|
|
|
title: "Usage: Email setup"
|
|
|
|
|
slug: "email-setup"
|
|
|
|
|
weight: 12
|
|
|
|
|
toc: true
|
|
|
|
|
draft: false
|
|
|
|
|
menu:
|
|
|
|
|
sidebar:
|
|
|
|
|
parent: "usage"
|
|
|
|
|
name: "Email setup"
|
|
|
|
|
weight: 12
|
|
|
|
|
identifier: "email-setup"
|
|
|
|
|
---
|
|
|
|
|
|
|
|
|
|
# Email setup
|
|
|
|
|
|
2020-03-13 20:50:14 +05:30
|
|
|
|
To use Gitea's built-in Email support, update the `app.ini` config file [mailer] section:
|
2019-10-16 17:04:20 +05:30
|
|
|
|
|
2020-03-13 20:50:14 +05:30
|
|
|
|
## Sendmail version
|
|
|
|
|
Use the operating system’s sendmail command instead of SMTP. This is common on Linux servers.
|
|
|
|
|
Note: For use in the official Gitea Docker image, please configure with the SMTP version.
|
2019-10-16 17:04:20 +05:30
|
|
|
|
```ini
|
|
|
|
|
[mailer]
|
2020-03-13 20:50:14 +05:30
|
|
|
|
ENABLED = true
|
|
|
|
|
FROM = gitea@mydomain.com
|
|
|
|
|
MAILER_TYPE = sendmail
|
|
|
|
|
SENDMAIL_PATH = /usr/sbin/sendmail
|
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
## SMTP version
|
|
|
|
|
```ini
|
|
|
|
|
[mailer]
|
|
|
|
|
ENABLED = true
|
|
|
|
|
FROM = gitea@mydomain.com
|
|
|
|
|
MAILER_TYPE = smtp
|
|
|
|
|
HOST = mail.mydomain.com:587
|
|
|
|
|
IS_TLS_ENABLED = true
|
|
|
|
|
USER = gitea@mydomain.com
|
|
|
|
|
PASSWD = `password`
|
2019-10-16 17:04:20 +05:30
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
- Restart Gitea for the configuration changes to take effect.
|
|
|
|
|
|
|
|
|
|
- To send a test email to validate the settings, go to Gitea > Site Administration > Configuration > SMTP Mailer Configuration.
|
|
|
|
|
|
2020-03-13 20:50:14 +05:30
|
|
|
|
For the full list of options check the [Config Cheat Sheet]({{< relref "doc/advanced/config-cheat-sheet.en-us.md" >}})
|
2020-04-07 01:48:42 +05:30
|
|
|
|
|
|
|
|
|
### Gmail
|
|
|
|
|
|
|
|
|
|
The following configuration should work with GMail's SMTP server:
|
|
|
|
|
|
|
|
|
|
```ini
|
|
|
|
|
[mailer]
|
|
|
|
|
ENABLED = true
|
|
|
|
|
HOST = smtp.gmail.com:465
|
|
|
|
|
FROM = example@gmail.com
|
|
|
|
|
USER = example@gmail.com
|
|
|
|
|
PASSWD = ***
|
|
|
|
|
MAILER_TYPE = smtp
|
|
|
|
|
IS_TLS_ENABLED = true
|
|
|
|
|
HELO_HOSTNAME = example.com
|
|
|
|
|
```
|