Nodemailer SSL和Gmail问题 [英] Nodemailer SSL and gmail problems

查看:63
本文介绍了Nodemailer SSL和Gmail问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

因此,我正在尝试设置我的应用程序以发送电子邮件.我使用我的gmail帐户设置了发送电子邮件的地址:

So I am trying to set up my app to send emails. I set it up using my gmail account to send the emails:

transport = nodemail.createTransport "SMTP", {
    service: "Gmail"
    auth: {
        user: "*"
        pass: "*"
    }
}

但是,当我发送电子邮件时,出现以下错误:

However when I send my email I get the following error:

{ [Error: 140735167607568:error:1409210A:SSL routines:SSL3_GET_SERVER_HELLO:wrong ssl version:../deps/openssl/openssl/ssl/s3_clnt.c:869:] stage: 'init' }

我不确定自己在做什么错.我按照说明进行操作,以完全按照他们在其网站上的指示进行设置.有任何想法吗?nodemailer出问题还是我正在做的事情很奇怪?

I am not sure what I am doing wrong. I followed the instructions to set this up exactly as they instruct on their site. Any ideas? Is it something wrong with nodemailer or just something weird that I am doing?

推荐答案

尝试像这样修改它:

var smtpTransport = nodemailer.createTransport("SMTP",{
    host: "smtp.gmail.com", // hostname
    secureConnection: false,
    port: 587, // port for secure SMTP
    requiresAuth: true,
    domains: ["gmail.com", "googlemail.com"],
        auth: {
        user: "***@gmail.com",
        pass: "***"
    }
});

这篇关于Nodemailer SSL和Gmail问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆