Advertisement
Guest User

Untitled

a guest
Apr 25th, 2017
133
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.47 KB | None | 0 0
  1. const smtpConfig = {
  2. host: 'smtp.gmail.com',
  3. secure: true, // use SSL
  4. auth: {
  5. user: process.env.GMAIL_ADDRESS,
  6. pass: process.env.GMAIL_PASSWORD,
  7. },
  8. }
  9. const transport = require('nodemailer').createTransport(smtpConfig)
  10.  
  11. module.exports.sendMail = ({ subject, text }) => {
  12. return transport.sendMail({
  13. from: process.env.GMAIL_ADDRESS,
  14. to: process.env.GMAIL_ADDRESS,
  15. subject,
  16. text,
  17. })
  18. .catch(err => console.error('Fail to send mail: ', err))
  19. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement