本文介绍了在cloud9.io中发送邮件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在本地使用 nodemailer 运行一个sails.js项目,效果很好。Nodemailer使用 Smtp 和Gmail的服务。问题是我在 cloud9 它阻止了邮件。

I am running a sails.js project using nodemailer locally which is working well.Nodemailer use Smtp and Gmail's service.Problem is when i transfer my project on cloud9 it is blocking mail.

smtpTransport = nodemailer.createTransport('SMTP', {
                    host: 'smtp.gmail.com',
                    port: 25,
                    service: 'Gmail',
                    auth: {

                        user: model.sender,
                        pass: model.password
                    }

                });

这是配置,错误是:

{ [Error: connect ETIMEDOUT]
code: 'ETIMEDOUT',
errno: 'ETIMEDOUT',
syscall: 'connect',
stage: 'init' }

来自不同的搜索,我知道c9.io不支持smtp如果是真的,那么我该如何使用带有c9的nodemailer将邮件发送到gmail帐户。

from different searches i got that c9.io isn't supporting smtp.if it is true then how can i use nodemailer with c9 to send mails to gmail account.

端口465 上,它会出现此错误

 { [AuthError: Invalid login - 534-5.7.14      <https://accounts.google.com/ContinueSignIn?sarp=1&scc=1&plt=AKgnsbv2r
534-5.7.14 5eXedgG1jE_vYL7r- o5CxdrMS5XlCbdbloPcENHa08v5fCwuvs7oM9ztAhkUh6RHfRvcBp
534-5.7.14 Qcpg_pdi-2E3Z9m1ipIvu4SZViMJABSDq3XWCMeLzlDfyS3C0JhoY7ldwRxsl3CZ67dvGQ
534-5.7.14
name: 'AuthError',
data: '534-5.7.14 <https://accounts.google.com/ContinueSignIn?   sarp=1&scc=1&plt=AKgnsbv2r\r\n534-5.7.14 5eXedgG1jE_vYL7r-o5CxdrMS5XlCbdbloPcENHa08v5fCwuvs7oM9ztAhkUh6RHfRvcBp\r\n534-5.7.14 Qcpg_pdi-2E3Z9m1ipIvu4SZViMJABSDq3XWCMeLzlDfyS3C0JhoY7ldwRxsl3CZ67dvGQ\r\n534-5.7.14 S7PQL4xbl4No8jS_2ZVMnlNO5iYfZ7O9tTe8S1bu3DnkFwjWNNzvLBZ3zK_pzIfMRnH566\r\n534-5.7.14 sEij4Iu9_U6V4g9tCuXH5i87nWYc> Please log in via your web browser and\r\n534-5.7.14 then try again.\r\n534-5.7.14 Learn more at\r\n534 5.7.14 https://support.google.com/mail/bin/answer.py?answer=78754 k6sm6950159wia.6 - gsmtp',
  stage: 'auth' }

{strong>端口587上的

,它会给出此错误

on port 587 it gives this error

{ [Error: 140581811607424:error:140770FC:SSL  routines:SSL23_GET_SERVER_HELLO:unknown  protocol:../deps/openssl/openssl/ssl/s23_clnt.c:795:
] stage: 'init' }


推荐答案

由于Cloud9工作区托管在GCE上,因此您必须使用上面文档中详细介绍的受支持的合作伙伴服务。

Since Cloud9 workspaces are hosted on GCE, you'll have to use the supported partner services as detailed in the above document.

这篇关于在cloud9.io中发送邮件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

05-17 21:45