我有一个场景,比如当用户使用他们的身份注册时,我必须向他们发送激活链接以进行验证。我不想通过 GMAIL/YAHOO/LIVE 等发送邮件。我可以从我的办公室创建一个组 mailID (xxx-support@yyy.com)。我的问题是我不知道如何设置这个过程。我该怎么办.. 我必须设置任何 SMTP 服务器吗???如果是,我的问题是如何创建 smtp 服务器?
Could you please help to get away from this bottleneck ??
smtpConfig = nodemailer.createTransport('SMTP', {
service: 'OfficeMailBox',
auth: {
user: "xxx-support@yyy.com",
pass: "yourpasswordgoeshere"
}
});
mailOpts = {
from: req.body.name + ' <' + req.body.email + '>',
to: 'me@gmail.com', //replace it with id you want to send multiple must be separated by ,
subject: 'contact form',
text: req.body.message
};
smtpConfig.sendMail(mailOpts, function (error, response) {
//Email not sent
if (error) {
res.end("Email send Falied");
}
//email send sucessfully
else {
res.end("Email send sucessfully");
}
});
问候拉姆