wasm-smtp-component
WASM Component Model interface for wasm-smtp.
Exports the smtp-send WIT interface defined in wit/smtp.wit, enabling
any language with WIT bindings (TypeScript, Go, Python, C, …) to send email
through wasm-smtp without writing Rust.
Quick start
# Build the .wasm component (requires cargo-component + wasm32-wasip2 target)
# Run unit tests on native (no WASM runtime required)
WIT interface
// wit/smtp.wit (abbreviated)
interface smtp-send {
send: func(
config: smtp-config,
credentials: smtp-credentials,
message: smtp-message,
) -> result<send-result, send-error>;
}
See wit/smtp.wit for the complete interface.
Language bindings
# TypeScript / JavaScript
# Go
Building
Prerequisites:
# Install cargo-component
# Add the WASM target
Then:
# → target/wasm32-wasip2/debug/wasm_smtp_component.wasm
Security
Credentials are passed as plain strings on each send call and are not
retained between calls. See docs/src/component-model.md for the threat model.
License
Apache-2.0. See LICENSE.