1

Can't get Nodemailer to send messages to my yahoo mail inbox. When a message is sent, I get a message that says "ReferenceError: processs is not defined". My interpretation is that it cannot access my .env file. I've been trying to solve this all day long. I originally had it connected to my personal gmail account, it worked at that point. Then I tried to connect it to a different gmail account, at which point it stopped working. I figured it was because I had to get an auth token or something from google, so being as my client uses Yahoo mail, I created a yahoo email account to connect it to, and that's where I'm at right now. I've been trying all day long. Here is my nodemailer method:

require('dotenv').config()
var nodemailer = require('nodemailer');


module.exports = {
    sendEmail: (req,res) => {
        console.log('-----hit', req.body)
        const { name, email, text } = req.body
        console.log('req.body', name, email, text)

var transporter = nodemailer.createTransport({
  service: 'yahoo',
  auth: {
    user: processs.env.NODEMAILER_ADDRESS,
    pass: process.env.NODEMAILER_PASSWORD
  },
  tls: {
    rejectUnauthorized: false
}
})


var mailOptions = {
  from: name + ' ' + process.env.NODEMAILER_ADDRESS,
  to: process.env.NODEMAILER_ADDRESS,
  subject: 'New Message From ' + name,
  text: name + ' ' + email + ' ' + text
};

transporter.sendMail(mailOptions, function(error, info){
  if (error) {
    console.log(error);
  } else {
    console.log('Email sent: ' + info.response);
  }
})
}}
3
  • 1
    There's a typo in the user value: user: processs Sep 10, 2018 at 21:47
  • That's it, thanks!
    – Aaron
    Sep 10, 2018 at 22:38
  • Glad it helped. I added an answer with this information so you can mark this question as resolved. Sep 10, 2018 at 22:46

1 Answer 1

0

There's a typo in the auth.user value: processs

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.