Skip to content

Commit

Permalink
vault backup: 2024-10-20 13:29:32
Browse files Browse the repository at this point in the history
  • Loading branch information
sdasd22q committed Oct 20, 2024
1 parent 199fcbc commit 81583f5
Show file tree
Hide file tree
Showing 2 changed files with 37 additions and 8 deletions.
17 changes: 9 additions & 8 deletions docs/blog/.obsidian/workspace.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,12 @@
"state": {
"type": "markdown",
"state": {
"file": "frontend/node/nest-core.md",
"file": "frontend/node/node-send-email.md",
"mode": "source",
"source": false
},
"icon": "lucide-file",
"title": "nest-core"
"title": "node-send-email"
}
}
]
Expand Down Expand Up @@ -93,7 +93,7 @@
"state": {
"type": "backlink",
"state": {
"file": "frontend/node/nest-core.md",
"file": "frontend/node/node-send-email.md",
"collapseAll": false,
"extraContext": false,
"sortOrder": "alphabetical",
Expand All @@ -103,7 +103,7 @@
"unlinkedCollapsed": true
},
"icon": "links-coming-in",
"title": "nest-core 的反向链接列表"
"title": "node-send-email 的反向链接列表"
}
},
{
Expand All @@ -112,12 +112,12 @@
"state": {
"type": "outgoing-link",
"state": {
"file": "frontend/node/nest-core.md",
"file": "frontend/node/node-send-email.md",
"linksCollapsed": false,
"unlinkedCollapsed": true
},
"icon": "links-going-out",
"title": "nest-core 的出链列表"
"title": "node-send-email 的出链列表"
}
},
{
Expand All @@ -139,10 +139,10 @@
"state": {
"type": "outline",
"state": {
"file": "frontend/node/nest-core.md"
"file": "frontend/node/node-send-email.md"
},
"icon": "lucide-list",
"title": "nest-core 的大纲"
"title": "node-send-email 的大纲"
}
}
]
Expand All @@ -165,6 +165,7 @@
"active": "4356ccb312dc0979",
"lastOpenFiles": [
"frontend/node/nest-core.md",
"frontend/node/node-send-email.md",
"frontend/node/oss-upload.md",
"frontend/node/file-upload.md",
"frontend/browser/cache.md",
Expand Down
28 changes: 28 additions & 0 deletions docs/blog/frontend/node/node-send-email.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
# node 如何发邮件

除了微信外,邮件也是我们常用的通讯方式,大多数人用邮箱客户端发邮件,比如qq邮箱,但是这样体验并不好。

比如:

1. 写邮件的时候:我有个漂亮的 `html` 页面,想直接把它作为邮件内容,或者我想用 `markdown` 来写邮件,但是它只支持富文本编辑器
2. 收邮件的时候:我想把一些重要邮件的内容保存下来,附件啥的都下载到本地。但是邮件多了的话,一个个手动下载太麻烦了。

我们可以使用 `node` 来用代码的方式实现收发邮件

## 邮件协议

邮件有专门的协议:

- 发邮件用 `SMTP` 协议。
- 收邮件用 `POP3` 协议、或者 `IMAP` 协议。

`node` 里也有对应的包,发邮件用 `nodemailer` 包,收邮件用 `imap` 包。

## 实践

首先,要开启 smtp、imap 等服务,这里以 qq 邮箱举例,在邮箱帮助中心 [service.mail.qq.com/](https://link.juejin.cn/?target=https%3A%2F%2Fservice.mail.qq.com%2F "https://service.mail.qq.com/") 可以搜到如何开启 smtp、imap 等服务

![image.png](https://codertzm.oss-cn-chengdu.aliyuncs.com/20241020132812.png)

开启后,然后在帮助中心页面搜索授权码

0 comments on commit 81583f5

Please sign in to comment.