Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- let transporter = nodemailer.createTransport({
- service: 'gmail',
- auth: {
- user: 'nufcblog92@gmail.com', //email address to send from
- pass: '38Bullers' //the actual password for that account
- }
- });
- var mailOptions = {
- from: 'Dave <nufcblog92@gmail.com>',
- to: 'nufcblog92@gmail.com',
- subject: 'Nodemailer test',
- text: 'You have reported this comment'
- }
- transporter.sendMail(mailOptions, function(err,res){
- if(err){
- console.log(err);
- } else {
- console.log('Email sent');
- }
- })
- <button id="report">Submit</button>
- $('#report').on('click', function(){
- transporter.sendMail(mailOptions, function(err,res){
- if(err){
- console.log(err);
- } else {
- console.log('Email sent');
- }
- })
- })
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement