第三方 SMTP
应用中配置 SMTP 邮件发送功能是非常重要的设置,它可以用于密码找回和重要操作的通知。
由于邮件系统的搭建非常复杂,其路由配置受制域名、防火墙、路由等多种因素制约,导致维护一个高可用的邮件系统非常困难。所以应用都建议集成第三方的 SMTP 服务来完成邮件通知功能。
SMTP 配置
下面是主流的邮箱提供商之 SMTP 服务设置(来源 )
QQ邮箱
- SMTP host: smtp.qq.com
- SMTP port: 465 or 587 for SSL-encrypted email
- SMTP Authentication: must be checked
- SMTP Encryption: must SSL
- SMTP username: email address
- SMTP password: 这个密码不是邮箱密码,是需要通过QQ邮箱SMTP设置去获取的授权码
The above is for quick reference only. see the QQ邮箱SMTP设置
163邮箱(网易)
- SMTP host: smtp.163.com
- SMTP port: 465 or 994 for SSL-encrypted email
- SMTP Authentication: must be checked
- SMTP Encryption: must SSL
- SMTP username: email address
- SMTP password: 这个密码不是邮箱密码,是需要通过163邮箱SMTP设置去获取的授权码
以上仅供快速设置参考,更多详情查看官网文档:163邮箱SMTP设置
阿里云邮箱
- SMTP host: smtp.mxhichina.com
- SMTP port: 465 for SSL-encrypted email
- SMTP 身份认证: 必须勾选
- SMTP 加密: 需启用SSL
- SMTP username: email address
- SMTP password: email password
以上仅供快速设置参考,更多详情查看官网文档: 阿里云邮箱SMTP设置
SendGrid
To configure your application to send email through SendGrid’s SMTP service, use the settings below. Replace USERNAME with your SendGrid account username and PASSWORD with your SendGrid account password.
- SMTP host: smtp.sendgrid.net
- SMTP port: 25 or 587 for unencrypted/TLS email, 465 for SSL-encrypted email
- SMTP username: USERNAME
- SMTP password: PASSWORD