EmailBuilder

Mutable builder for Email; usually used through emailBuilder.

Constructors

Link copied to clipboard
constructor()

Properties

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard

The Date header; the time of rendering is used if null.

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
var html: String?
Link copied to clipboard
Link copied to clipboard

The Message-ID without angle brackets; generated from the sender's domain if null.

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
var text: String?
Link copied to clipboard

Functions

Link copied to clipboard
fun appendHtml(value: String)
Link copied to clipboard
fun appendText(value: String)
Link copied to clipboard
fun attach(name: String, content: ByteArray, contentType: String = Attachment.guessContentType(name))

Attach a file.

Link copied to clipboard
fun bcc(vararg addresses: EmailAddress)
fun bcc(address: String, name: String? = null)
Link copied to clipboard
fun build(): Email
Link copied to clipboard
fun cc(vararg addresses: EmailAddress)
fun cc(address: String, name: String? = null)
Link copied to clipboard
fun embed(contentId: String, content: ByteArray, contentType: String, name: String = contentId.substringBefore('@'))

Embed a file that the HTML body references via cid:<contentId>.

Link copied to clipboard
fun from(address: String, name: String? = null)

Set the sender, either john@example.com or John <john@example.com> if name is null.

Link copied to clipboard
fun header(name: String, value: String)

Add a custom header, e.g. List-Unsubscribe.

Link copied to clipboard
fun prependHtml(value: String)
Link copied to clipboard
fun prependText(value: String)
Link copied to clipboard
fun replyTo(vararg addresses: EmailAddress)
fun replyTo(address: String, name: String? = null)
Link copied to clipboard
fun to(vararg addresses: EmailAddress)
fun to(address: String, name: String? = null)