I am sending emails from NodeJS using Nodemailer and sestransport on AWS, and am wondering how I can change the 'from name'?
fFr example, for from I put
    const mailOptions =
    {
      from:     '<[email protected]>',
      to:       '[email protected]',
      subject:  'Hi',
    }
When I get the email, it appears to come from 'noreply'. I would like to be able to change to name to anything, for example 'tom hanks', but still have the reply address [email protected]. Is that possible?
Simply specify it before the email address:
const mailOptions =
{
  from:     '"Tom Hanks" <[email protected]>',
  to:       '[email protected]',
  subject:  'Hi',
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With