D
D
Denis11112019-02-03 00:25:53
Node.js
Denis1111, 2019-02-03 00:25:53

Why doesn't the from option work in nodemailer?

There is a code:

const smtpTransport = nodemailer.createTransport({
    service: "Gmail",
    auth: {
      user: "***@gmail.com",
      pass: "***"
    }
  });

  const mailOptions = {
    from: '<[email protected]>',
    to: "***@gmail.com",
    subject: "Заказ сайта",
    text: message,
    html: message
  }

  smtpTransport.sendMail(mailOptions, (err, info) => {
    if (err) {
      console.log(err)
    } else {
      console.log(info);
    }
  });

I receive a message on gmail mail:
From: "I"
To: "I"
I.e. no sender. Although I am passing the correct data
How can I make it so that the user can send a message to my mail?

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question