> For the complete documentation index, see [llms.txt](https://ayakaleaf-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://ayakaleaf-pro.ayaka.space/on-premises/zh-tw/she-ding/overleaf-toolkit/email-delivery.md).

# 電子郵件傳送

Overleaf 支援透過兩種方法發送電子郵件：簡易郵件傳輸協定（SMTP）和 [Amazon Simple Email Service（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` 時，即使伺服器支援，也不使用 TLS `STARTTLS` 擴充功能                                                           |
| `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> 如果您有任何問題，請參閱我們的常見問題 \<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://ayakaleaf-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://ayakaleaf-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.
