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版)
发送邮件
|
107
能以各种语言发送邮件,希望邮件能做更多高级的事情,比如包含格式化文本、图片和附
件。这时候事情就开始变得难办了。邮件格式和编码使得各种技术和标准陷入一片混乱。
幸运的是,我们不需要解决这些复杂问题,
Nodemailer
可以帮我们解决
。你只需要知道,
你的邮件既可以是普通文本(
Unicode
)
,也可以是
HTML
。
所有现代的邮件应用都支持
HTML
邮件
,因此把邮件格式化为
HTML
通常来说是相当安
全的。不过,目前还是有一些排斥
HTML
邮件的
“纯文本主义者”,因此,建议总是同时
包含纯文本邮件和
HTML
邮件
。如果你不喜欢写两种,那么
Nodemailer
可以提供便利,
它支持由
HTML
自动生成纯文本版本。
11.5
 
HTML
邮件
关于
HTML
邮件的内容足够写一本书了。遗憾的是,
HTML
邮件并不像为网站写
HTML
那么简单,大多数邮件客户端仅支持
HTML
的一个小子集
。这意味着大多数时候你写
HTML
邮件的感觉就好像还在
1996
年一样
,没有什么乐趣。尤其是你不得不像过去那样,
使用
table
做布局。
如果你处理过
HTML
的浏览器兼容性问题
,就知道那是一件令人头痛的事。但电子邮件的
兼容性问题更令人头痛。好在有一些好东西可以帮助处理这个问题。
首先,建议你读读
MailChimp
的优秀文章
“
About HTML Email
”。它阐述了一些基本原则
以及在写
HTML
邮件时需要牢记的东西。
接着,我会给你一个节省时间的利器:
HTML
邮件样板
。这里面基本都是写得很好并经过
严格测试的
HTML
邮件模板。
最后是测试 ...
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

Publisher Resources

ISBN: 9787115565099