Skip to Content
Node与Express开发(第2版)
book

Node与Express开发(第2版)

by Ethan Brown
June 2021
Intermediate to advanced
290 pages
9h 21m
Chinese
Posts & Telecom Press
Content preview from Node与Express开发(第2版)
106
|
第
11
章
如果你现在在一个组织内工作,组织本身可能已经有
MSA
了,那么可以联系
IT
部门,询
问他们是否有适用于发送自动化邮件的
SMTP
转发服务可用。
如果准备使用
SendGrid
或
Mailgun
,那么现在就去设置一下你的账号
。使用
SendGrid
前,
你需要先创建一个
API key
(它将是你的
SMTP
密码)
。
11.2
 接收邮件
大多数网站只要求能够
发送
邮件,诸如发送密码重置指引和促销邮件。有些应用也要求能
够接收邮件。问题跟踪系统就是一个很好的例子。每当有人提出一个问题,系统就会发出
一封邮件,如果你回复了这封邮件,系统就自动以你回复的内容来回复这个问题。
不幸的是,接收邮件比发送邮件要复杂很多,所以本书并不打算涉及这个部分。如果你的
确需要接收邮件,就应该让你的邮件服务商维护收件箱,然后使用一个
IMAP
代理
(如
imap-simple
)定期访问收件箱。
11.3
 邮件头
一封电子邮件由两部分组成:邮件头和邮件主体(跟
HTTP
请求非常相像)。
邮件头
包含
关于邮件的信息:发件人、收件人、收件日期、主题,等等。在邮件应用中,这些头信息
通常都会显示给用户,但除了这些还有很多其他的头信息。大多数邮件客户端允许你查看
邮件头,如果从来没看过,建议你看一看。这些邮件头可以告诉你这封邮件是如何送到你
这里的,邮件所经过的每个服务器和
M
TA
都会在邮件头中列出来。
很多人会感到奇怪:为什么有些邮件头可以由发送者任意设置,比如发件人地址
“
from
”
?当把发件人地址指定为不同于发件人账号的地址时,就是常说的
邮件欺诈
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.

Read now

Unlock full access

More than 5,000 organizations count on O’Reilly

AirBnbBlueOriginElectronic ArtsHomeDepotNasdaqRakutenTata Consultancy Services

QuotationMarkO’Reilly covers everything we've got, with content to help us build a world-class technology community, upgrade the capabilities and competencies of our teams, and improve overall team performance as well as their engagement.
Julian F.
Head of Cybersecurity
QuotationMarkI wanted to learn C and C++, but it didn't click for me until I picked up an O'Reilly book. When I went on the O’Reilly platform, I was astonished to find all the books there, plus live events and sandboxes so you could play around with the technology.
Addison B.
Field Engineer
QuotationMarkI’ve been on the O’Reilly platform for more than eight years. I use a couple of learning platforms, but I'm on O'Reilly more than anybody else. When you're there, you start learning. I'm never disappointed.
Amir M.
Data Platform Tech Lead
QuotationMarkI'm always learning. So when I got on to O'Reilly, I was like a kid in a candy store. There are playlists. There are answers. There's on-demand training. It's worth its weight in gold, in terms of what it allows me to do.
Mark W.
Embedded Software Engineer

You might also like

面向对象的思考过程(原书第5版)

面向对象的思考过程(原书第5版)

马特 魏斯费尔德
精通模块化JavaScript

精通模块化JavaScript

Nicolás Bevacqua
前端架构设计

前端架构设计

Micah Godbolt

Publisher Resources

ISBN: 9787115565099