使用nodemailer通过Office365 smtp(MEANjs支架)发送电子邮件时发生错误

编程入门 行业动态 更新时间:2024-10-25 23:25:48
本文介绍了使用nodemailer通过Office365 smtp(MEANjs支架)发送电子邮件时发生错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

我试图使用Office365 SMTP发送电子邮件使用Nodemailer(在MEANjs支架),但我收到以下错误:

I'm trying to use Office365 SMTP to send email using Nodemailer (in a MEANjs scaffold), but I get the following error:

[Error: 140735277183760:error:140770FC:SSL routines:SSL23_GET_SERVER_HELLO:unknown protocol:../deps/openssl/openssl/ssl/s23_clnt.c:795:]

我使用以下Nodemailer选项:

I'm using the following Nodemailer options:

{ host: 'smtp.office365', port: '587', auth: { user: 'xxxx', pass: 'xxxx' }, secure: 'false', tls: { ciphers: 'SSLv3' } }

删除 tls 字段没有什么区别。我缺少什么?

Removing the tls field doesn't make a difference. What am I missing?

推荐答案

解决方案很简单。 'secure'字段应该是'secureConnection'。生成配置的MEANjs脚手架使用'secure'字段创建了邮件程序选项。其余的选项是罚款。对于需要工作的Office 365 SMTP nodemailer选项块的任何人,以下应该可以工作:

The solution was simple. The 'secure' field should be 'secureConnection'. The MEANjs scaffold that generated the configs created mailer options with the 'secure' field. The rest of the options are fine. For anyone that needs a working Office365 SMTP nodemailer options block, the following should work:

{ host: 'smtp.office365', port: '587', auth: { user: 'xxxx', pass: 'xxxx' }, secureConnection: false, tls: { ciphers: 'SSLv3' } }

更多推荐

使用nodemailer通过Office365 smtp(MEANjs支架)发送电子邮件时发生错误

本文发布于:2023-10-13 00:25:32,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1486289.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:支架   发生错误   发送电子邮件   nodemailer   MEANjs

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!