Send emails from the browser

This page is a Kobweb app compiled to JavaScript. It builds the email with Kotlinmailer and sends it over JMAP, directly from your browser to your mail server. There is no backend.

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.