Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- const nodemailer = require('nodemailer');
- const xoauth2 = require('xoauth2');
- var express = require('express');
- var smtpTransport = nodemailer.createTransport({
- service:"Gmail",
- host: 'smtp.gmail.com',
- auth:{
- XOAuth2: {
- user:'strictusdev@gmail.com',
- clientId: '127714859906-enpor8c7v4shq8khd8daa4uit44jdpgi.apps.googleusercontent.com',
- clientSecret: 'aFzrdnpv9NDFsJDhc9fddN2C',
- access_token: "ya29.GluaBdwouirfAJZldzWtILf012qxwOI1XBaiyssu6RKx9zYx_7v3PRuaPetP4KBjbTzSi5uIbxINERYSu02gTl-CVscdbEFqZUsHRxm4Qy6ig12QMqL4XKpULPTg",
- // "token_type": "Bearer",
- // "expires_in": 3600,
- refresh_token: "1/ztehZKQZYvxKjlOu5UMep_U2VTCxyQyppbf9sWmmJC4"
- }
- }
- });
- var mailOptions = {
- from: 'strictusdev@gmail.com',
- to: 'strictusdev@gmail.com',
- subject: "Hello",
- generateTextFromHTML: true,
- html: "<b>Hello world</b>"
- };
- smtpTransport.sendMail(mailOptions, function(error, response) {
- if (error) {
- console.log(error);
- } else {
- console.log(response);
- }
- smtpTransport.close();
- });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement