在服务器端(wakanda 10),我发送电子邮件时:
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连接处理程序
有人有主意吗?
发布于 2016-05-11 15:40:52
使用mail.send代替message.send,并将域:'gmail.com'添加到传递给send()的对象:
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帐户的设置中启用“访问不太安全的应用程序”。允许不太安全的应用程序访问帐户
https://stackoverflow.com/questions/37164391
复制相似问题