Рас
function foo(email, password) {
nodemailer.createTestAccount(function(err, account) {
var transporter = nodemailer.createTransport({
host: 'smtp.ethereal.email',
port: 587,
secure: true,
auth: {
user: account.user,
pass: account.pass
}
});
var message = {
from: '"Heano" <games.1212@yandex.ru>',
to: email,
subject: 'Регистрация ✔',
text: 'Твой пароль: '+ password,
html: 'Твой пароль:<b> '+ password+'</b>'
};
transporter.sendMail(message, function (err, info) {
if (err) {
console.log('Error:' + err.message);
return;
}
console.log('Server responded with ' + info.response);
});
});
}
Два
foo('f@ya.ru', '1')