SMTP envelope

SMTP envelope is usually auto generated from from, to, cc and bcc fields 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.

envelope is an object with the following params: from, to, cc and bcc just like with regular mail options. You can also use the regular address format, unicode domains etc.

mailOptions = {
    ...,
    from: '[email protected]', // listed in rfc822 message header
    to: '[email protected]', // listed in rfc822 message header
    envelope: {
        from: 'Daemon <[email protected]>', // used as MAIL FROM: address for SMTP
        to: '[email protected], Mailer <[email protected]>' // used as RCPT TO: address for SMTP
    }
}

Not all transports can use the envelope object, for example SES ignores it and only uses the data from the From:, To: etc. headers.