An SMTP transaction is valid from MAIL FROM time until RSET or "final-dot".
A unique UUID for this transaction. Is equal to the connection.uuid + '.N' where N increments for each transaction on this connection.
The value of the MAIL FROM command as an
An Array of
Address objects of recipients from the RCPT TO command.
An Array of the lines of the email after DATA.
The number of bytes in the email after DATA.
Adds a line of data to the email. Note this is RAW email - it isn't useful for adding banners to the email.
A safe place to store transaction specific values.
- transaction.add_leading_header(key, value)
Adds a header to the top of the header list. This should only be used in very specific cases. Most people will want to use add_header() instead.
- transaction.add_header(key, value)
Adds a header to the email.
Deletes a header from the email.
The header of the email. See
Set to 1 to enable parsing of the mail body. Make sure you set this in hook_data or before.
The body of the email if you set
parse_body above. See
- transaction.attachment_hooks(start, data, end)
Sets event emitter hooks for attachments if you set
start event will receive
(content_type, filename, body) as parameters.
data event will receive a
Buffer object containing some of the
end event will be called with no parameters when an attachment ends.
end params are optional.
Note that in the
start event, you can set per-attachment events via:
body.on('attachment_data', cb) body.on('attachment_end', cb)
- transaction.set_banner(text, html)
Sets a banner to be added to the end of the email. If the html part is not
given (optional) then the text part will have each line ending replaced with
<br/> when being inserted into HTML parts.