Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- var nodemailer = require('nodemailer');
- const subscribe = {
- send: function(name, service) {
- const transporter = nodemailer.createTransport({
- service: 'Gmail',
- auth: {
- user: 'your gmail username',
- pass: 'your gmail password'
- },
- }, {
- from: 'Sender Name <your-gmail-username@gmail.com>',
- });
- const message = {
- to: '"Your name" <your-gmail-username@gmail.com>',
- subject: 'Some subject line',
- text: 'This is the body of your email. Use string concat to add variables in here',
- };
- transporter.sendMail(message, function (error, info) {
- if (error) {
- console.log('Err', error.message);
- return;
- }
- console.log('Message sent successfully 🔥');
- });
- },
- }
- module.exports = subscribe;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement