首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >Wakanda邮件不发送

Wakanda邮件不发送
EN

Stack Overflow用户
提问于 2016-05-11 13:37:32
回答 1查看 152关注 0票数 1

在服务器端(wakanda 10),我发送电子邮件时:

代码语言:javascript
复制
var mail = require('waf-mail/mail');
var message = new mail.Mail();
message.from = 'emailadres of the sender';
message.to = [theEmailadres];
message.subject = 'Here the subject of the email';
message.setBodyAsHTML('Here the HTML content of the email');
message.send('smtp.gmail.com', 465, true, 'username', 'password');

看起来手术被冻结了。当我关闭调试器时,我在日志文件中得到以下错误:

2016-05-11 15:17:55 com.wasanda-Sofare.xbox错误-1/断管(kOTSerialOverrunErr /EPIPE),任务#21523,任务名称是HTTP连接处理程序

有人有主意吗?

EN

回答 1

Stack Overflow用户

发布于 2016-05-11 15:40:52

使用mail.send代替message.send,并将域:'gmail.com'添加到传递给send()的对象:

代码语言:javascript
复制
var mail = require('waf-mail/mail'); 
var message = new mail.Mail();
message.subject = "Here the subject of the email";
message.from = "emailadres of the sender";
message.to = 'theEmailadres';
message.setBodyAsHTML("Here the HTML content of the email");
mail.send({
    address: 'smtp.gmail.com', 
    port: 465,
    isSSL: true,
    username: 'username', 
    password: 'password', 
    domain: 'gmail.com'
}, message);

它对我来说是完美的,请注意,Google可能会阻止连接尝试,如果这样的话,在发送者gmail帐户的设置中启用“访问不太安全的应用程序”。允许不太安全的应用程序访问帐户

票数 2
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/37164391

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档