SMTP envelope is usually auto generated from from, to, cc and bcc fields in the message object but if for some reason you want to specify it yourself (custom envelopes are usually used for VERP addresses), you can do it with the envelope property in the message object.
let message = {
...,
from: 'mailer@nodemailer.com', // listed in rfc822 message header
to: 'daemon@nodemailer.com', // listed in rfc822 message header
envelope: {
from: 'Daemon <deamon@nodemailer.com>', // used as MAIL FROM: address for SMTP
to: 'mailer@nodemailer.com, Mailer <mailer2@nodemailer.com>' // used as RCPT TO: address for SMTP
}
}
The envelope object returned by sendMail() includes just from (address string) and to (an array of address strings) fields as all addresses from to, cc and bcc get merged into to when sending.