使用NodeJs ExpressJs

时间:2015-05-08 00:44:17

标签: angularjs node.js mongodb meanjs

我是MeanJS框架(MongoDb,ExpressJS,NodeJS和AngularJS)的新手,我需要你的帮助来解释我如何发送包含新用户链接的电子邮件以验证他的地址?

1 个答案:

答案 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!'
});