Example #1
0
function transport(service)
{	
	if(service != 'smpt' && service != '')
	{	
		return nodemailer.createTransport(smtpTransport({
							   service: service,
							   auth: {
							       user: config.email.auth.user,
							       pass: config.email.auth.pass
							   }
							}));
	}
	else  
	{
		if(service == 'smtp')
		{
			return  nodemailer.createTransport(smtpTransport({
							   host: config.email.smtp.host,
							   port: config.email.smtp.port,
							   auth: {
							       user: config.email.auth.user,
							       pass: config.email.auth.pass
							   }
							}));
		}
		else
		{
			return nodemailer.createTransport();
		}		
	}
}
        Object3D.findOne({ id: id }).exec(function(err, obj3D) {
            // send message to admin
            // TODO
            // sails.config.mails.__mnhn
            var nodemailer = require('nodemailer');
            var smtpTransport = require('nodemailer-smtp-transport');

            // create reusable transporter object using SMTP transport
            /*var transporter = nodemailer.createTransport({
                service: sails.config.mail.__service,
                auth: {
                    user: sails.config.mail.__user,
                    pass: sails.config.mail.__pass
                }
            });*/
            
            if(sails.config.mail.__useAuthent) {
                console.log("Send mail with authent");
                var transporter = nodemailer.createTransport(smtpTransport({
                    host: sails.config.mail.__host,
                    port: sails.config.mail.__port,
                    auth: {
                        user: sails.config.mail.__user,
                        pass: sails.config.mail.__pass
                    },
                    tls: {rejectUnauthorized: false}
                }));
            }
            else {
                console.log("Send mail without authent");
                var transporter = nodemailer.createTransport(smtpTransport({
                    host: sails.config.mail.__host,
                    port: sails.config.mail.__port,
                    tls: {rejectUnauthorized: false}
                }));
            }

            subject = 'Contact (' + obj3D.getTitle() + ')';

            // setup e-mail data with unicode symbols
            var mailOptions = {
                from: sender,
                to: sails.config.mail.__mnhn,
                subject: 'Contact',
                text: msg,
                html: msg
            };

            // send mail with defined transport object
            transporter.sendMail(mailOptions, function(error, info){
                if(error){
                    console.log(error);
                }else{
                    console.log('Message sent: ' + info.response);
                }
            });            
            
            return  res.json({status: true});
        });
exports.send = function(email){
    var payload = {
      sub: email
    }
    var token = jwt.encode(payload, config.EMAIL_SECRET);

    var transporter = nodemailer.createTransport(smtpTransport({
        host:'smtp.mailgun.org',
        secure: true,
        auth: {
            user: config.SMTP_USER,
            pass: config.SMTP_PASSWORD
        }
    }));

    var mailOptions = {
        from: 'Accounts <*****@*****.**>',
        to:email,
        subject: 'Account Verification',
        html: getHtml(token)
    };

    transporter.sendMail(mailOptions, function(err, info){
        if (err) return res.status(500, err);
        console.log('email sent ', info.response);
    });
}
Example #4
0
/** ****************************************************************************
  * Name:       sendEmail()
  *             Function uses notemailer to create a transport and sends a
  *             verification email with the verification code
  *
  * @param      email <string> :: code <string>
  * @returns
  *****************************************************************************/
function sendEmail(email,code){
     //sess=req.session;
     var rec_email = email;
     //var code = "ABC";
     console.log("send EMAIL CALLED :: " + email);
     var transporter = nodemailer.createTransport(
          smtpTransport({
        service: 'Gmail',
        auth: {
            user: '******', // Your email id
            pass: '******' // Your password
       }})
 );

console.log('SMTP Configured');
     var mailOptions = {
          tls: { rejectUnauthorized: false },
           from: '*****@*****.**', // sender address
           to: rec_email, // list of receivers
           subject: 'Welcome to eVaca', // Subject line
           text: "Welcome to eVaca, here's your verification code:" + code
     };
     transporter.sendMail(mailOptions, function(error, info){
         if(error){
             console.log(error);
         }else{
             console.log('Message sent: ' + info.response);
         };
     });
}
Example #5
0
    app.route('/api/mail/test').get(function(req, res) {
        process.env.NODE_TLS_REJECT_UNAUTHORIZED = 0;
        var transporter = nodemailer.createTransport(smtpTransport({
            name: 'outlook',
            host: 'host.com',
            port: 587,
            auth: {
                user: '******',
                pass: '******'
            }

        }));
        console.log(transporter);
        transporter.sendMail({
            to: '*****@*****.**',
            cc: '*****@*****.**',
            subject: 'hello test',
            text: 'hello world!',
            debug: true
        }, function(error, info) {
            if (error) {
                return console.log(error);
            }
            console.log('Message sent: ' + info.response);
            res.send(info.response);
        });
        res.send("sent finish.");
    });
	var inviteFriend = function(req, res) {
		var emails = req.body.emails || [];
		res.send({
			success: true
		});

		var smtpTransporter = nodemailer.createTransport(smtpTransport(config.mail));

		var text = config.mail.invite_text.replace(/\{[(a-z]+\}/ig, function(name) {
			if (name == '{host}') return req.header('host');
			if (name == '{username}') return req.session.username;
			if (name == '{email}') return req.session.email;
		});

		console.log('invite email text: ' + text);
		emails.forEach(function(email) {
			smtpTransporter.sendMail({
				from: config.mail.from,
				to: email,
				subject: config.mail.invite_subject,
				text: text,
			}, function(err,info) {
				if(err) return console.error(err);
				console.log(info);
			});
		});
	};
Example #7
0
              }, function(token, asyncDone) {
                // Send verify email

                // Skip if email hasn't been set up
                if (!config.email.verify.fromAddress) {
                  asyncDone(new Error("Email verify.fromAddress not found in configuration"));
                  return;
                }

                var transport = nodemailer.createTransport(smtpTransport(config.email.smtp));

                var mailOptions = {
                  to: newUser.email,
                  from: config.email.verify.fromAddress,
                  subject: (config.email.verify.subject) ? config.email.verify.subject : "Please verify your account",
                  text: "You are receiving this because an account has been registered using this email address and requires verification before it can be used.\n\n" +
                    "Please click on the following link, or paste this into your browser to complete the verification process:\n\n" +
                    (config.siteURL || "http://" + req.headers.host) + "/verify/" + token + "\n\n" +
                    "If you did not request this, please ignore this email.\n"
                };

                transport.sendMail(mailOptions, function(err) {
                  if (err) {
                    debug("Unable to send email via SMTP server. Is it running?");
                    asyncDone(err);
                    return;
                  }

                  req.flash("message", "A verification link has been sent by e-mail to " + newUser.email + ".");

                  asyncDone(null, newUser);
                });
              }
router.post("/message", async function (ctx, next) {
    const {fields} = await asyncBusboy(ctx.req);
    let options = {
        service: 'Gmail',
        port: 587,
        auth: {
            user: '******',
            pass: '******'
        },
        debug: true
    };
    // create reusable transporter object using the default SMTP transport
    let transporter = nodemailer.createTransport(smtpTransport(options));

// setup e-mail data with unicode symbols
    let mailOptions = {
        from: 'Ashutosh Sharma ✔ <*****@*****.**>', // sender address
        to: 'ashuanindian@gmail.com, ashutosh@ashu.online', // list of receivers
        subject: 'Hi Ashutosh you got a message from ' + fields.name, // Subject line
        text: fields.message + "\n\nPlease contact s/he on " + fields.email // plaintext body
    };

// send mail with defined transport object
    ctx.body = await new Promise(function(resolve, reject) {
        transporter.sendMail(mailOptions, function (error, info) {
            if (error) {
                reject("error");
            }
            console.log('Message sent: ' + info.response);
            resolve("Success");
        });
    });
});
Example #9
0
    sendMail: function* (email, text) {

        // 开启一个 SMTP 连接池
        var transport = nodemailer.createTransport(smtpTransport(configSMTP));

        // 设置邮件内容
        var mailOptions = {
            'from': '*****@*****.**',// 发件地址
            'to': email,// 收件列表
            'subject': '校园传单单位注册审核结果',// 标题
            'html': text
        };

        // 发送邮件
        transport.sendMail(mailOptions, function(error, response) {
            if (error) {
                console.error(error);
            } else {
                console.log(response);
            }

            // 如果没用,关闭连接池
            transport.close();
        });
    }
Example #10
0
 sendEmail: function (info) {
     var emailConfig = {
       user: "******",
       clientId: "145148843209-nsegq60u23dsqiquh8kjtd2c5secc73n.apps.googleusercontent.com",
       clientSecret: "lV5_mni9R80yV8WJ_BziqjAY",
       refreshToken: "1/r9vftK7C6D8ceQhbpu0QXBPF4mpTELxOOs1XQwhNGdwMEudVrK5jSpoR30zcRFq6",
     };
     if (!info) { return; }
     info.html = info.body;
     var generator = require('xoauth2').createXOAuth2Generator(emailConfig);
     var transport = nodemailer.createTransport(smtpTransport({
         service: 'gmail',
         auth: {
             xoauth2: generator
         }
     }))
     transport.sendMail(info, function (error, response) {
         if (error) {
             console.log(error);
         } else {
     console.log(response);
         }
         transport.close();
     });
 }
Example #11
0
 function(token, user, done) {
   var sgriduser;
   var sgridpass;
   if (app.get('env') === 'development') {
     var sg = require('../../sendgrid');
     sgriduser = sg.username;
     sgridpass = sg.password;
   }else{
     sgriduser = process.env.SENDGRID_USERNAME;
     sgridpass = process.env.SENDGRID_PASSWORD;
   }
   var smtpTransporter = nodemailer.createTransport(smtpTransport({
     service: 'SendGrid',
     auth : {
       user : sgriduser,
       pass : sgridpass
     }
   }));
   var mailOptions = {
     to: user.email,
     from: '*****@*****.**',
     subject: 'moodRing Password Reset',
     text: 'You are receiving this because you (or someone else) have requested the reset of the password for your account.\n\n' +
       'Please click on the following link, or paste this into your browser to complete the process:\n\n' +
       'http://' + req.headers.host + '/users/reset/' + token + '\n\n' +
       'If you did not request this, please ignore this email and your password will remain unchanged.\n'
   };
   smtpTransporter.sendMail(mailOptions, function(err) {
     req.flash('info', 'An e-mail has been sent to ' + user.email + ' with further instructions. It should arrive shortly');
     res.redirect('/users/login');
   });
 }], function(err) {
Example #12
0
exports.send = function (email) {
	var payload = {
		sub: email
	}

	var token = jwt.encode(payload, config.EMAIL_SECRET);

	var transporter = nodemailer.createTransport(smtpTransport({
		host: 'smtpout.secureserver.net',
//		host: 'smtpout.secureserver.net',
		secure: true,
		auth: {
			user: '******',
			pass: config.SMTP_PASS
		}
	}));

	var mailOptions = {
		from: 'Accounts <*****@*****.**>',
		to: email,
		subject: 'psJwt Account Verification',
		html: getHtml(token)
	};

	transporter.sendMail(mailOptions, function (err, info) {
		if (err) return res.status(500, err);

		console.log('email sent ', info.response);
	})
}
    function sentMessages(i) {
        var user = listUsers[i];

        var transporter = nodemailer.createTransport(smtpTransport({
            service: 'yandex',
            pool: true,
            auth: {
                user: user.user,
                pass: user.pass
            }
        }));
        // send mail
        transporter.sendMail({
            from: user.user,
            to: user.mailto,
            subject: user.themeMail,
            text: user.bodyMail
        }, function (error, response) {
            if (error) {
                console.log(error);
                winston.log('error', error);
            } else {
                console.log('Message sent');
                winston.log('info', 'Message sent and we logging with winston');
                if (i<listUsers.length) {i++;setTimeout(function(){sentMessages(i)},10000)}
            }
        });
        // verify connection configuration
        transporter.verify(function (error, success) {
            if (error) {
                console.log(error);
            } else {
                console.log('Server is ready to take our messages');
            }
        });}
    send: function (email, cb) {

        /** sets up the modemailer smtp transport */

        var transport = nodemailer.createTransport();
        if (sails.config.nodemailer.method == 'smtp') {
            var smtpTransport = require('nodemailer-smtp-transport');
            transport = nodemailer.createTransport(smtpTransport(sails.config.nodemailer.settings));
        }

        /** sets up the mail options, from and such like that **/
        var from = email.from || '*****@*****.**';

        if (sails.config.nodemailer.prepend_subject) {
            var subject = sails.config.nodemailer.prepend_subject + email.subject;
        } else {
            var subject = email.subject;
        }

        var mailOptions = {
            from: email.name + '<' + from + '>',
            to: email.to,
            subject: subject,
            html: email.messageHtml
        }

        /** Actually sends the email */
        transport.sendMail(mailOptions, function (err, response) {
            if (err) return cb(err);
            return cb(null, response);
        });
    }
Example #15
0
function mailer(req, res, mailer, mailOptions, mongoose)
{
	var transporter = mailer.createTransport(smtpTransport('smtps://yungfrezh90%40gmail.com:1deepC90@smtp.gmail.com'));
	
	transporter.sendMail(mailOptions, function(err, info)
	{
		if(err)
		{
			console.log(err);
			
			res.status(500).send(err);
			
			var db = mongoose.connection.db;
			
			var collection = db.collection("Users");
			
			collection.remove({User: req.body.user}, function(err)
			{
				
			});
		}
		
		else
		{
			console.log(info.response);
			res.status(200).send("Welcome");
		}
	});
}
Example #16
0
var sendMail = function(mailOptions){
	var result='';
	console.log(mailOptions);
	var transporter = nodemailer.createTransport(smtpTransport({
	  host: mailconf.conf.host,
	  port:mailconf.conf.port,
	  auth: {
	     user: mailconf.conf.username,
	     pass: mailconf.conf.password
	  },
	  tls: {
        rejectUnauthorized: false
      }
	}));
	transporter.sendMail(mailOptions, function(error, info){
		if(error){
		    console.log(error);
		    result=error;
		}
		else{
		    console.log(info);
		    result=info.response;      
		}
	});
	console.log(result);
}
function mailTransportConfig() {
    if (process.env.MC_SMTP_HOST === 'localhost') {
        return smtpTransport();
    } else {
        return `smtps://${process.env.MC_VERIFY_EMAIL}:${process.env.MC_VERIFY_PASS}@${process.env.MC_SMTP_HOST}`;
    }
}
Example #18
0
	var mailer = function(options, name, addr, subject, html, text, cb){
		var transport = nodemailer.createTransport(smtpTransport({
			host: options.host,
			port: options.port || (options.ssl ? 465 : 25),
			secureConnection: !!options.ssl,
			auth: {
				user: options.user,
				pass: options.password
			}
		}));
		if(typeof(text) === 'undefined' || text === null)
			text = html
				.replace(/\s+/g, ' ')
				.replace(/^ /g, '')
				.replace(/ $/g, '')
				.replace(/ ?<\/p> ?/ig, '\r\n\r\n')
				.replace(/ ?<br> ?/ig, '\r\n')
				.replace(/<.*?>/g, '');
		transport.sendMail({
			from: (options.name ? options.name + ' <' + options.addr + '>' : options.addr),
			to: (name ? name + ' <' + addr + '>' : addr),
			subject: subject,
			html: html,
			text: text
		}, function(err, res){
			transport.close();
			if(cb) cb(err, res);
		});
	};
Example #19
0
Email.prototype.send = function(user) {debugger;
    console.log(JSON.stringify(user));
    var d = Q.defer();
    var mailOptions = {
        from: '*****@*****.**',
        to: user.email,
        subject: 'OTP CPay Registration ',
        text: 'Welcome to CPay',
        html: '<span>Your OTP <b>'+user.otp+'</b>'
    };
    var transporter = nodemailer.createTransport(smtpTransport({
        host: "smtp.gmail.com",
        secure: false,
        port: 587,
        auth: {
            user:"******",
            pass:"******"
        }
        /*logger: true*/
    }));
    transporter.sendMail(mailOptions, function(error, response){
        if(error){
            console.log(error);
            d.reject({status:"user created. otp not sent"});
        }else{
            console.log("Message sent: " + response);
            d.resolve({status:"otp sent"});
        }
    });
    return d.promise;
};
Example #20
0
        connection.query('UPDATE users set password=? where user_id=?;',[new_pass,search.user_id],function(err2){
          if(err2) next (err2);
          else{

            smtpTransport = nodemailer.createTransport(smtpTransport({
              service:'gmail',
              auth:{
                user:'******',
                pass:'******'
              }
            }));

            var mailOptions = {
              from:'소포 <*****@*****.**>',
              to:search.email,
              subject:'소포 비밀번호 찾기 서비스',
              html:"<h1>비밀번호 찾기</h1><p>"+user[0].name+"님의 비밀번호는 "+new_pass+"입니다.</p>"
            };

            smtpTransport.sendMail(mailOptions,function(error,response){
              if(error){
                console.log(error);
              }else{
                console.log("Message send : " + response.message);
              }
              smtpTransport.close();
            });

          res.render('./home/password_search',{message:'임시 비밀번호가 전송되었습니다.'});
          }
          });
Example #21
0
router.post('/sendEmail', function(req, res){
  var transporter = nodemailer.createTransport(smtpTransport({
    service: 'Gmail', // loads nodemailer-ses-transport
    auth:{
      user: config.email.username,
      pass: config.email.password
    }
	}));

	var mailOptions = {
	    from: "\"" + req.body.name + "\" <" + req.body.email + ">", // sender address
	    to: ["*****@*****.**", config.email.username], // list of receivers
	    subject: "Question from " + req.body.company, // Subject line
	    text: util.format("From: %s,\n%s",req.body.email, req.body.question)// plaintext body
	};

	// send mail with defined transport object
	transporter.sendMail(mailOptions, function(error, info){
	    if(error){
	        console.log(error);
	        res.render('error');
	    }
	    console.log('Message sent: ' + info.response);
	    res.render('contact', { 'title':'Contact', 'success':true, partials : { layout : 'layout'}});
	});
});
		newUser.save(function(err, user) {
			if (err) {
				req.flash('error', err);
				return res.redirect('/reg');
			}
			req.session.user = user;

			//发送成功注册邮件
			var transport = nodemailer.createTransport(smtpTransport(configInfo.hostConfig));
			console.log('Email = ', user.email);
			configInfo.targetInfo.to = user.email;  
			console.log(configInfo);
			transport.sendMail(configInfo.targetInfo, function(error, response) {
				if (error) {
					console.log(error);
					return;
				} else {
					console.log("Message sent: " + response.message);
				}
				transport.close();
			});

			req.flash('success', '注册成功!');
			res.redirect('/');
		});
Example #23
0
var sendMail = function(toAddress, fromAddress, emailSubject, htmlContent, plainTextContent, callback){
  var nodemailer = require("nodemailer");
  var smtpTransport = require('nodemailer-smtp-transport');

  var transporter = nodemailer.createTransport(smtpTransport({
    host: config.MAIL_HOST,
    port: config.MAIL_PORT,
    secure: config.MAIL_SECURE,
    ignoreTLS: config.MAIL_IGNORE_TLS,
    auth: {
      user: config.MAIL_USER,
      pass: config.MAIL_PASSWORD
    }
  }));

  var mailOptions = {
    to: toAddress,
    from: (fromAddress !== undefined ? fromAddress : undefined),
    subject: emailSubject,
    text: (plainTextContent !== undefined ? plainTextContent : undefined),
    html: htmlContent
  };

  transporter.sendMail(mailOptions, function(error, info){
    if(error){
      logger("The '{0}' email to {1} couldn't be sent. Stacktrace: {2}".format(emailSubject, toAddress, error), "CRITICAL");
    } else {
      logger("The '{0}' email to {1} was succefully sent.".format(emailSubject, toAddress), "INFO");
    }

    callback((error ? true : false));
  });
};
Emailer.send = function(data) {
    var username = Meta.config['emailer:local:username'];
    var pass = Meta.config['emailer:local:password'];
    var transportOptions = {
      secure: true,
        host: Meta.config['emailer:local:host'],
        port: parseInt(Meta.config['emailer:local:port'],10)
    };
    if( username || pass ) {
        transportOptions.auth = {
            user: username,
            pass: pass
        };
    }
    var transport = nodemailer.createTransport(smtpTransport(transportOptions));
    transport.sendMail({
        from: data.from,
        to: data.to,
        html: data.html,
        text: data.plaintext,
        subject: data.subject
    },function(err,response) {
        if ( !err ) {
            winston.info('[emailer.smtp] Sent `' + data.template + '` email to uid ' + data.uid);
        } else {
            winston.warn('[emailer.smtp] Unable to send `' + data.template + '` email to uid ' + data.uid + '!!');
        }
    });
}
			function(err, doc) {
				if (err) return res.send(err);
				if (!doc) return res.send({
					code: 40400,
					errmsg: '邮件不存在'
				});
				res.send(doc);

				var smtpTransporter = nodemailer.createTransport(smtpTransport(config.mail));
				var text = config.mail.reset_text.replace(/\{[(a-z]+\}/ig, function(name) {
					if (name == '{host}') return req.header('host');
					if (name == '{token}') return doc._id
				});
				console.log('forgot password email content: ' + text);
				smtpTransporter.sendMail({
						from: config.mail.from,
						to: email,
						subject: config.mail.reset_subject,
						text: text,
					},
					function(err,info) {
						if(err) return console.error(err);
						console.log(info);
					}
				);
			}
 User.create(model, function(error, data){
   if(error){
     res.view('user/error', {message: 'При регистрации пользователя произошла ошибка: ' + error.message});
   }
   else{
     var nodemailer = require('nodemailer');
     var smtpTransport = require('nodemailer-smtp-transport');
     var transporter = nodemailer.createTransport(smtpTransport({
         host: 'mx.onego.ru',
         port: 25,
         ignoreTLS: true
       })
     );
     var mailOptions ={
       from: '*****@*****.**' ,
       to: model.email,
       subject: 'User Activation Email',
       text: 'http://localhost:1337/user/register/?id='+data.id+'&t='+model.password
     };
     transporter.sendMail(mailOptions, function(error, info){
       if(error){
         res.view('user/error', {message: 'При регистрации пользователя произошла ошибка: ' + error.message});
       }
       else res.view('user/after_register');
     });
   }
 });
		Account.create(user, function(err, doc) {
			if (err) {
				if(err.code == 11000){
					return res.send({code: 11000, errmsg: '该邮箱已注册'});
				}
				return res.send(err);
			}
			res.send(doc);

			var smtpTransporter = nodemailer.createTransport(smtpTransport(config.mail));
			var text = config.mail.register_text.replace(/\{[(a-z]+\}/ig, function(name) {
				if (name == '{host}') return req.header('host');
				if (name == '{email}') return user.email;
				if (name == '{code}') return user.registerCode;
			});

			console.log('register confirm email text: ' + text);
			smtpTransporter.sendMail({
					from: config.mail.from,
					to: user.email,
					subject: config.mail.register_subject,
					text: text,
				},
				function(err,info) {
					if(err) return console.error(err);
					console.log(info);
				}
			);
		});
    User.findOne({id: req.session.user.id}).exec(function(error, user){
        var nodemailer = require('nodemailer');
        var smtpTransport = require('nodemailer-smtp-transport');
        var transporter = nodemailer.createTransport(smtpTransport({
            host: 'mx.onego.ru',
            port: 25,
            ignoreTLS: true
          })
        );
        var mailOptions ={
          from: '*****@*****.**' ,
          to: user.email,
          subject: 'User Activation Email',
          text: 'http://localhost:1337/user/register/?id='+user.id+'&t='+user.password
        };
        transporter.sendMail(mailOptions, function(error, info){
          if(error){
            res.view('user/error', {message: 'При отправке письма произошла ошибка: ' + error.message});
          }
          else {
            delete req.session.user;
            res.view('user/after_register');

          }
        });

    });
Example #29
0
function sendIt(senderName,senderEmail,senderPassword,recepient,message) {
	var transporter=nodemailer.createTransport(nodemailer_smtp({
		host: "smtp.gmail.com",
		port: 465,
		secure: true,
		auth: {
			user: senderEmail,
			pass: senderPassword
		}
	}));

	var mailOptions={
		from: senderName+" <"+senderEmail+">",
		to: recepient,
		subject: "no-reply",
		text: message
	};

	transporter.sendMail(mailOptions, function(error,info) {
		if (error) {
			console.log(error);
		} else {
			console.log("Email sent.");
		}
	});
}
Example #30
0
var sendEmail = function(email, subject, body) {

    process.env.NODE_TLS_REJECT_UNAUTHORIZED = 0;
    console.log(body);
    //test email
    //email="*****@*****.**"
    //subject="Test ! "+subject
    var transporter = nodemailer.createTransport(smtpTransport({
        name: 'outlook',
        host: 'mailhost.host.com',
        port: 587,
        auth: {
            user: '******',
            pass: '******'
        }

    }));

    transporter.sendMail({
        from: "Report <*****@*****.**>",
        to: email,
        bcc:'*****@*****.**',
        subject: subject,
        html: body,
        debug: true
    }, function(error, info) {
        if (error) {
            return console.log(error);
        }
        console.log('Message sent: ' + info.response);
    });
}