Appends an attachment.
The data is retained by reference until the message is built. Callers must not mutate it in the meantime.
Appends a file attachment with an application/octet-stream content type.
Appends an inline attachment referenced by contentId, for example from cid: HTML.
Adds envelope recipients without a visible Bcc header.
Adds envelope and Cc header recipients.
Sets the Date header. When unset, the time of sending is used.
Sets the envelope sender and the From header.
Appends a custom header.
Sets the HTML body.
When both a text and an HTML body are set, the message is sent as multipart/alternative.
Sets the In-Reply-To header for threading.
Sets the Message-ID header. The value is wrapped in angle brackets when needed.
Uses a null reverse-path while keeping the From header.
It is intended for bounce and other auto-generated messages. A From header is still required
for a valid message.
Sets the References header for threading.
Sets the Reply-To header.
Sets the Sender header, required when From contains more than one mailbox.
Sets the Subject header. Non-ASCII subjects are RFC 2047 encoded.
Sets the plain-text body.
When both a text and an HTML body are set, the message is sent as multipart/alternative.
Adds envelope and To header recipients.
A mutable, chainable builder for an email message.
Chained methods return the receiver, so a message is normally composed in a single expression. A
Messageis not safe for concurrent use. It can be sent repeatedly; each send serializes the current state.Example