diff --git a/README.md b/README.md
index f2d84c3..dc7ebbe 100644
--- a/README.md
+++ b/README.md
@@ -11,7 +11,9 @@
"mailConfig": {
"user":"",
"pass":"",
- "mailto":""
+ "mailto":"",
+ "smtpServer":"",
+ "smtpPort":""
}
}
```
@@ -20,6 +22,21 @@
>> user 发送方邮箱
>> pass 有授权码的填授权码,没有的填密码,填了密码报错了找授权码
>> mailto 接收方邮箱
+
+>> smtpServer 发送邮件时使用的 smtp 服务器地址
+
+>> smtpPort smtp 服务器端口
+
+对于常用的邮件而言,配置列举如下
+
+|服务|server|port|
+|:-:|:----:|:---:|
+|QQ 邮箱|smtp.qq.com|465/587|
+|网易邮箱|smtp.163.com|465|
+|...|...|...|
+
+其余邮箱服务的配置可以在对应服务商的帮助文档中找到
+
### 用户配置
先放一个配置模板
```
diff --git a/global.json b/global.json
index 768730b..b20de12 100644
--- a/global.json
+++ b/global.json
@@ -3,6 +3,8 @@
"mailConfig": {
"user":"",
"pass":"",
- "mailto":""
+ "mailto":"",
+ "smtpServer":"",
+ "smtpPort":""
}
}
\ No newline at end of file
diff --git a/index.js b/index.js
index 8e40021..9072934 100644
--- a/index.js
+++ b/index.js
@@ -31,8 +31,8 @@ log.info("获取成功")
if (globalConfig.sendMail == true) {
log.info("组装邮件发射器")
var transporter = nodemailer.createTransport({
- host: 'smtp.163.com',
- port: 465,
+ host: globalConfig.mailConfig.smtpServer,
+ port: globalConfig.mailConfig.smtpPort,
secure: true,
auth: {
user: globalConfig.mailConfig.user,