docs: add documents about smtp

pull/90/head
moonrailgun 2 years ago
parent 912c74ce72
commit 4abf332b94

@ -1,6 +1,6 @@
---
sidebar_position: 1
title: cli Test Method
title: Cli Test Method
---
First of all, you need to make sure that `tailchat-cli` has been installed, and the version is above `1.5.8`. For the installation method, see: [tailchat-cli](../cli/tailchat-cli.md)

@ -0,0 +1,45 @@
---
sidebar_position: 10
title: SMTP Service (optional)
---
`Tailchat` includes email services, used in scenarios such as **password recovery**, **mail authentication**
Only simple mail service (SMTP) is used in `Tailchat` because only one-way sending mail is required and no receiving mail is required.
In order to enable the service, we need to set the following in the environment variable:
- `SMTP_SENDER`: sender information, the general format is `xxx@example.com` or `"YourName" xxx@example.com`
- `SMTP_URI`: SMTP mail service address, follow the international common URI format: <protocol>://<username>:<password>@<host>:<port>/<other-info>
## Auxiliary testing using cli
If you are not familiar with SMTP service, in order to improve detection efficiency, you can choose to use `tailchat-cli` to quickly help you verify the reliability of SMTP service
> For usage of tailchat-cli, see [tailchat-cli](../cli/tailchat-cli.md)
```
tailchat smtp
SMTP Service
Commands:
tailchat smtp verify Verify smtp sender service
tailchat smtp test Send test email with smtp service
Options:
--version Show version number [boolean]
-h, --help Show help [boolean]
```
You can verify URI availability with `tailchat smtp verify`, no email is actually sent during this operation. Similar to account login
If there are still problems after the verification is passed, you can use `tailchat smtp test` to actually send a test email to help you troubleshoot the problem, because there are many possibilities in the actual production environment, such as bounced letters caused by audit problems of various service providers, such as The degree of verification is different. For example, some service providers allow custom sender names, and some have strict requirements on them.
## SMTP_URI example
Because the services provided by different service providers are different, only some of the content can be cited here for demonstration. If you have other URIs that can be used as examples, please submit a PR to help us improve the documentation together:
- `smtps://<email-address>:<password>@smtp.exmail.qq.com/?pool=true`
- `smtps://<email-address>:<password>@smtp.163.com/?pool=true`

@ -1,5 +1,5 @@
---
sidebar_position: 10
sidebar_position: 50
title: Troubleshooting
---

@ -0,0 +1,45 @@
---
sidebar_position: 10
title: SMTP 服务(可选)
---
`Tailchat` 包含邮件服务, 使用的场景如 **密码找回**、**邮件认证**
因为仅需要单向的发送邮件而无需接受邮件,因此在 `Tailchat` 中仅使用简单邮件服务(SMTP).
为了启用该服务,我们需要在环境变量中设置如下内容:
- `SMTP_SENDER`: 发送人信息, 一般的格式是 `xxx@example.com``"YourName" xxx@example.com`
- `SMTP_URI`: SMTP邮件服务地址, 遵循国际通用URI格式: <protocol>://<username>:<password>@<host>:<port>/<other-info>
## 使用 cli 进行辅助测试
如果你对 SMTP 服务不熟,为了提高检测效率你可以选择使用 `tailchat-cli` 来快速帮你验证 smtp 服务可靠性
> 关于 tailchat-cli 的使用见 [tailchat-cli](../cli/tailchat-cli.md)
```
tailchat smtp
SMTP Service
Commands:
tailchat smtp verify Verify smtp sender service
tailchat smtp test Send test email with smtp service
Options:
--version Show version number [boolean]
-h, --help Show help [boolean]
```
你可以使用 `tailchat smtp verify` 验证URI可用性在这个操作中是不会实际发送邮件的。类似于账号登录
如果验证通过后依旧有问题,你可以使用`tailchat smtp test`来实际发送测试邮件来帮助你排查问题,因为实际生产环境中可能性非常多,比如各个服务商的审核问题导致的退信,比如验证程度不一样如有的服务商允许自定义发信人名称有的对其有严格的要求
## SMTP_URI 示例
因为不同的服务商提供的服务各有差异, 这里只能举出部分内容用于演示。如果你有其他的可以作为示例的URI欢迎提交PR来帮助我们一起完善文档:
- `smtps://<email-address>:<password>@smtp.exmail.qq.com/?pool=true`
- `smtps://<email-address>:<password>@smtp.163.com/?pool=true`

@ -1,5 +1,5 @@
---
sidebar_position: 10
sidebar_position: 50
title: 常见问题
---

Loading…
Cancel
Save