Package-level declarations

Types

Link copied to clipboard
class Attachment(val name: String, val content: ByteArray, val contentType: String = guessContentType(name), val contentId: String? = null)

A file attached to an Email.

Link copied to clipboard
class Email

An immutable email message. Create one with emailBuilder.

Link copied to clipboard
class EmailAddress(address: String, name: String? = null)

A mailbox, consisting of an address (local@domain) and an optional display name.

Link copied to clipboard

Mutable builder for Email; usually used through emailBuilder.

Link copied to clipboard
annotation class EmailDsl
Link copied to clipboard
class Header(val name: String, val value: String)

A custom header field.

Functions

Link copied to clipboard
inline fun Email.copy(builder: EmailBuilder.() -> Unit = {}): Email

Copy this email, modify it with builder and build it with a new message id.

Link copied to clipboard
inline fun emailBuilder(builder: EmailBuilder.() -> Unit): Email

Build a new Email.

Link copied to clipboard
inline fun Email.forward(from: EmailAddress, builder: EmailBuilder.() -> Unit = {}): Email

Forward this email. The original is attached as message/rfc822.

Link copied to clipboard
inline fun Email.reply(from: EmailAddress, toAll: Boolean = false, builder: EmailBuilder.() -> Unit = {}): Email

Reply to this email. The new email is addressed to the Email.replyTo addresses (or Email.from), keeps the thread headers and quotes the original body.