1. JMAP server
For Fastmail, create an API token with the Email and Email submission scopes under Settings → Privacy & Security → API tokens. Your credentials are only sent to the server above and are not stored.
2. Message
Kotlin code
val mailer = jmapMailer("https://api.fastmail.com/jmap/session") {
bearer("<api-token>")
}
emailBuilder {
from("")
to("")
subject = "Hello from Kotlinmailer"
text = "This email was sent by a Kotlin/JS website, straight from the browser over JMAP."
withHTML {
body {
h2 { +subject }
p { +text }
}
}
}.send(mailer)
Result
Nothing sent yet.