我是MeanJS框架(MongoDb,ExpressJS,NodeJS和AngularJS)的新手,我需要你的帮助来解释我如何发送包含新用户链接的电子邮件以验证他的地址?
答案 0 :(得分:4)
使用k-d tree。
从自述文件中获取的一个简单示例:
var nodemailer = require('nodemailer');
var transporter = nodemailer.createTransport();
transporter.sendMail({
from: 'sender@address',
to: 'receiver@address',
subject: 'hello',
text: 'hello world!'
});
也可以通过SMTP发送电子邮件(使用Gmail,Hotmail等):
var nodemailer = require('nodemailer');
var transporter = nodemailer.createTransport({
service: 'gmail',
auth: {
user: 'sender@gmail.com',
pass: 'password'
}
});
transporter.sendMail({
from: 'sender@address',
to: 'receiver@address',
subject: 'hello',
text: 'hello world!'
});