Я не знаю, что мне не хватает, я использую пример Nodemailer:
var nodemailer = require("nodemailer");
// create reusable transport method (opens pool of SMTP connections)
var smtpTransport = nodemailer.createTransport("SMTP",{
service: "Gmail",
auth: {
user: "[email protected]",
pass: "userpass"
}
});
// setup e-mail data with unicode symbols
var mailOptions = {
from: "Fred Foo ✔ <[email protected]>", // sender address
to: "[email protected], [email protected]", // list of receivers
subject: "Hello ✔", // Subject line
text: "Hello world ✔", // plaintext body
html: "<b>Hello world ✔</b>" // html body
}
// send mail with defined transport object
smtpTransport.sendMail(mailOptions, function(error, response){
if(error){
console.log(error);
}else{
console.log("Message sent: " + response.message);
}
// if you don't want to use this transport object anymore, uncomment following line
//smtpTransport.close(); // shut down the connection pool, no more messages
});
Я просто сменил пользователя и передал аутентификацию в свою учетную запись Gmail (также пробовал с их значениями), и я изменил адрес электронной почты «на» на свой адрес электронной почты. Я получил:
{ [Error: connect ECONNREFUSED]
code: 'ECONNREFUSED',
errno: 'ECONNREFUSED',
syscall: 'connect' }
Что мне не хватает? Я не вижу ничего в документации, где говорится, что мне нужно сделать что-то большее, чем это, так почему это не сработает? Заранее спасибо.
openssl s_client -connect smtp.gmail.com:465
- person Andris   schedule 02.02.2013