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.
Renders a template into the message body.
The renderer runs inside Client.send before the message is built, so it
may be asynchronous. When a renderer is attached, its HTML replaces any
explicit html() body, and its text replaces an explicit text() body
when it produces one; an explicit subject() always wins. When both text
and HTML are present after rendering, the message is sent as
multipart/alternative.
Calling this more than once replaces the previous renderer. The builder is not mutated by rendering; each send resolves it anew.
The template renderer, for example from a plugin package.
The template representation the renderer understands.
This builder.
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