Ktor / Kotlin 发送邮箱验证码(2026):用 HTTP API 发 OTP
在 Ktor 里做注册/登录邮箱验证码:SecureRandom、HMAC 落 ConcurrentHashMap/Redis/SQL、限流、用 HttpClient 调 POST /emails 并带 Idempotency-Key——优先 HTTPS 而非 SMTP;对照 Quarkus 与 Spring Boot 兄弟篇;Rovela 只负责投递。
在 Ktor 里做注册/登录邮箱验证码:SecureRandom、HMAC 落 ConcurrentHashMap/Redis/SQL、限流、用 HttpClient 调 POST /emails 并带 Idempotency-Key——优先 HTTPS 而非 SMTP;对照 Quarkus 与 Spring Boot 兄弟篇;Rovela 只负责投递。

介绍如何用 Kotlin 的 HttpURLConnection、OkHttp 或 Ktor 客户端发送事务邮件,包含幂等键重试、协程 Semaphore 批量发送,以及 Ktor 服务端和 Spring Boot 的 Webhook 验签。