> For the complete documentation index, see [llms.txt](https://overleaf-pro.ayaka.space/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://overleaf-pro.ayaka.space/on-premises/zh-tw/she-ding/overleaf-toolkit/email-delivery.md).

# 電子郵件傳送

Overleaf 支援透過兩種方式傳送電子郵件：簡易郵件傳輸協定（SMTP）和 [Amazon 簡易電子郵件服務（SES）](https://aws.amazon.com/ses/). 如果你的 localhost 上已啟用一個電子郵件伺服器，且該伺服器正在監聽本機連線，則可以使用 SMTP。

## 設定

電子郵件是使用以下環境變數設定的。

#### 寄件者設定

| 名稱                            | 描述                                                                                                                                |
| ----------------------------- | --------------------------------------------------------------------------------------------------------------------------------- |
| `OVERLEAF_EMAIL_FROM_ADDRESS` | <p>寄件者地址，例如 <a href="mailto:support@mycompany.com"><code>'<support@mycompany.com>'</code></a><br><br>- <strong>必填</strong>: 是</p> |
| `OVERLEAF_EMAIL_REPLY_TO`     | 回覆地址，例如 `'noreply@mycompany.com'`                                                                                                 |

#### SMTP

| 名稱                                      | 描述                                                                                                                                              |
| --------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------- |
| `OVERLEAF_EMAIL_SMTP_HOST`              | 要連線的主機名稱或 IP 位址。需要可從 Docker 容器存取                                                                                                                |
| `OVERLEAF_EMAIL_SMTP_PORT`              | 要連線的埠號                                                                                                                                          |
| `OVERLEAF_EMAIL_SMTP_SECURE`            | 如果 `true` 連線到伺服器時將使用 TLS。若 `false` 或未設定，則如果伺服器支援 `STARTTLS` 擴充功能，TLS 就會被使用。在大多數情況下，請將此值設為 `true` 如果你是連線到埠號 `465`。對於埠號 `587` 或 `25` 請保持為 `false` |
| `OVERLEAF_EMAIL_SMTP_USER`              | 應用於向 SMTP 伺服器驗證的使用者名稱                                                                                                                           |
| `OVERLEAF_EMAIL_SMTP_PASS`              | 與 SMTP 使用者名稱相關聯的密碼                                                                                                                              |
| `OVERLEAF_EMAIL_SMTP_TLS_REJECT_UNAUTH` | 如果 `false` 這會開啟與 TLS 伺服器的連線，但使用自簽或無效的 TLS 憑證                                                                                                    |
| `OVERLEAF_EMAIL_SMTP_IGNORE_TLS`        | 當 `true` 以及 `OVERLEAF_EMAIL_SMTP_SECURE` 是 `false` 時，即使伺服器支援 `STARTTLS` 擴充功能，也不會使用 TLS                                                          |
| `OVERLEAF_EMAIL_SMTP_NAME`              | 若 `OVERLEAF_EMAIL_SMTP_HOST` 被設定為 IP 位址，則用於 TLS 驗證的可選主機名稱，預設為該機器的主機名稱。                                                                          |
| `OVERLEAF_EMAIL_SMTP_LOGGER`            | 當 `true` 將記錄訊息輸出至 `web.log`.                                                                                                                    |

#### Amazon SES SMTP 介面

你可以閱讀更多關於使用 Amazon SES SMTP 介面傳送電子郵件的資訊 [這裡](https://docs.aws.amazon.com/ses/latest/dg/send-email-smtp.html).

| 名稱                         | 描述                               |
| -------------------------- | -------------------------------- |
| `OVERLEAF_EMAIL_SMTP_HOST` | 要連線的主機名稱或 IP 位址。需要可從 Docker 容器存取 |
| `OVERLEAF_EMAIL_SMTP_PORT` | 要連線的埠號                           |
| `OVERLEAF_EMAIL_SMTP_USER` | 應用於向 SMTP 伺服器驗證的使用者名稱            |
| `OVERLEAF_EMAIL_SMTP_PASS` | 與 SMTP 使用者名稱相關聯的密碼               |

#### Amazon SES API

你可以閱讀更多關於使用 Amazon SES API 傳送電子郵件的資訊 [這裡](https://docs.aws.amazon.com/ses/latest/dg/send-email-api.html).

| 名稱                                     | 描述                   |
| -------------------------------------- | -------------------- |
| `OVERLEAF_EMAIL_AWS_SES_ACCESS_KEY_ID` | 如果使用 AWS SES，則為存取金鑰  |
| `OVERLEAF_EMAIL_AWS_SES_SECRET_KEY`    | 如果使用 AWS SES，則為私密金鑰  |
| `OVERLEAF_EMAIL_AWS_SES_REGION`        | 若未設定，預設區域為 US-EAST-1 |

#### 使用執行個體角色的 AWS SES

| 名稱                      | 描述                                                       |
| ----------------------- | -------------------------------------------------------- |
| `OVERLEAF_EMAIL_DRIVER` | 當此值設定為 `ses`時，電子郵件系統將使用 SES API 方法，並依賴已設定的執行個體角色來傳送電子郵件。 |

#### 自訂

| 名稱                             | 描述                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     |
| ------------------------------ | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `OVERLEAF_CUSTOM_EMAIL_FOOTER` | <p>附加到所有電子郵件的自訂 HTML，例如<br><br><strong>範例</strong>: <code>"\<div>此系統由 x 部門營運 \</div> \<div> 如果您有任何問題，請查看我們的 FAQ \<a href='</code><a href="https://docs.overleaf.com/on-premises/configuration/overleaf-toolkit/https:/somwhere.com&#x27;%3Ehere&#x26;#x3C;/a%3E&#x26;#x3C;/div%3E"><code>[https://somwhere.com'>這裡\&#x26;#x3C;/a>\&#x26;#x3C;/div>](https://overleaf-pro.ayaka.space/on-premises/zh-tw/she-ding/overleaf-toolkit/https:/somwhere.com'>這裡\&#x26;#x3C;/a>\&#x26;#x3C;/div>)</code></a><code>"</code></p> |


---

# 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 dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://overleaf-pro.ayaka.space/on-premises/zh-tw/she-ding/overleaf-toolkit/email-delivery.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
