
Enables email creation and sending via external SMTP servers, utilizing coroutines and DSLs for streamlined implementation. Supports TLS and integrates with SimpleJavaMail for enhanced MimeMessage handling.
Send emails from any Kotlin platform: a Ktor backend, an Android or iOS app, a CLI tool or even the browser.
Documentation · API reference · Live demo · Migrating from 1.x
Kotlinmailer is a Kotlin Multiplatform mail library, built on coroutines and DSLs. It has its own SMTP and JMAP clients and doesn't need Java Mail.
This project is a hard fork of SimpleKotlinMail, which is no longer actively maintained.
val mailer = smtpMailer("smtp.example.com") {
credentials("john.doe@example.com", "app-password")
}
emailBuilder {
from("John Doe <john.doe@example.com>")
to("alice@example.com")
subject = "Hello from Kotlin"
text = "Sent from any platform!"
}.send(mailer)dependencies {
implementation("at.quickme.kotlinmailer:core:2.0.0")
implementation("at.quickme.kotlinmailer:smtp:2.0.0") // and/or jmap, html
}| Module | Platforms |
|---|---|
core, html, jmap
|
JVM, JS, Wasm, macOS, iOS, Linux, Windows |
smtp |
JVM (incl. Android), Node.js, macOS, iOS, Linux and Windows (without TLS) |
jmap needs a Ktor client engine, e.g. ktor-client-cio or
ktor-client-js. See Modules for Maven and more details.
The demo is a Kobweb website that sends
emails over JMAP straight from your browser, without a backend. SMTP can't work there, because browsers can't open TCP
connections. The source is in demo.
Contributions are very welcome, whether it's code, documentation or a good bug report.
To work on the code you need JDK 21. Then:
./gradlew check # tests on every platform your machine supports, detekt and the API check
./gradlew apiDump # after changing the public API, commit the updated api/ files
./gradlew :demo:kobwebStart -t # run the demo at http://localhost:8080/Kotlinmailer/demo/ with live reloadsmtp or jmap. core stays dependency-light and compiles for every target.commonTest.docs/Writerside.fix(smtp): ... or
docs: ....More details are in the contribution guide.
Kotlinmailer is licensed under the Apache License 2.0.
Send emails from any Kotlin platform: a Ktor backend, an Android or iOS app, a CLI tool or even the browser.
Documentation · API reference · Live demo · Migrating from 1.x
Kotlinmailer is a Kotlin Multiplatform mail library, built on coroutines and DSLs. It has its own SMTP and JMAP clients and doesn't need Java Mail.
This project is a hard fork of SimpleKotlinMail, which is no longer actively maintained.
val mailer = smtpMailer("smtp.example.com") {
credentials("john.doe@example.com", "app-password")
}
emailBuilder {
from("John Doe <john.doe@example.com>")
to("alice@example.com")
subject = "Hello from Kotlin"
text = "Sent from any platform!"
}.send(mailer)dependencies {
implementation("at.quickme.kotlinmailer:core:2.0.0")
implementation("at.quickme.kotlinmailer:smtp:2.0.0") // and/or jmap, html
}| Module | Platforms |
|---|---|
core, html, jmap
|
JVM, JS, Wasm, macOS, iOS, Linux, Windows |
smtp |
JVM (incl. Android), Node.js, macOS, iOS, Linux and Windows (without TLS) |
jmap needs a Ktor client engine, e.g. ktor-client-cio or
ktor-client-js. See Modules for Maven and more details.
The demo is a Kobweb website that sends
emails over JMAP straight from your browser, without a backend. SMTP can't work there, because browsers can't open TCP
connections. The source is in demo.
Contributions are very welcome, whether it's code, documentation or a good bug report.
To work on the code you need JDK 21. Then:
./gradlew check # tests on every platform your machine supports, detekt and the API check
./gradlew apiDump # after changing the public API, commit the updated api/ files
./gradlew :demo:kobwebStart -t # run the demo at http://localhost:8080/Kotlinmailer/demo/ with live reloadsmtp or jmap. core stays dependency-light and compiles for every target.commonTest.docs/Writerside.fix(smtp): ... or
docs: ....More details are in the contribution guide.
Kotlinmailer is licensed under the Apache License 2.0.