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: 'mailer@kreata.ee', // listed in rfc822 message header
    to: 'daemon@kreata.ee', // listed in rfc822 message header
    envelope: {
        from: 'Daemon <deamon@kreata.ee>', // used as MAIL FROM: address for SMTP
        to: 'mailer@kreata.ee, Mailer <mailer2@kreata.ee>' // 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.