armature-mail

Crates.ioarmature-mail
lib.rsarmature-mail
version0.1.1
created_at2025-12-27 00:53:48.793208+00
updated_at2025-12-30 22:28:44.592482+00
descriptionEmail sending with SMTP, templates, and provider integrations for Armature
homepagehttps://pegasusheavy.github.io/armature
repositoryhttps://github.com/pegasusheavy/armature
max_upload_size
id2006516
size190,015
Joseph R. Quinn (quinnjr)

documentation

README

armature-mail

Email sending for the Armature framework.

Features

  • SMTP Support - Send via any SMTP server
  • Templates - HTML email templates
  • Attachments - File and inline attachments
  • Providers - SendGrid, Mailgun, AWS SES
  • Async - Non-blocking email sending

Installation

[dependencies]
armature-mail = "0.1"

Quick Start

use armature_mail::{Mailer, Email};

#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
    let mailer = Mailer::smtp("smtp.example.com")
        .credentials("user", "password")
        .build()?;

    let email = Email::new()
        .from("sender@example.com")
        .to("recipient@example.com")
        .subject("Hello!")
        .body("This is a test email.");

    mailer.send(email).await?;
    Ok(())
}

HTML Templates

let email = Email::new()
    .from("sender@example.com")
    .to("recipient@example.com")
    .subject("Welcome!")
    .html(render_template("welcome.html", &context)?);

Providers

SendGrid

let mailer = Mailer::sendgrid("API_KEY").build()?;

AWS SES

let mailer = Mailer::ses(region).build()?;

License

MIT OR Apache-2.0

Commit count: 0

cargo fmt