rust_smtp_utils 0.1.0

Reusable SMTP helper crate for Rust (lettre-based) with STARTTLS, timeout, and retry.
Documentation
use rust_smtp_utils::{SmtpConfig, send_text_email};
use lettre::message::Mailbox;

fn main() -> Result<(), Box<dyn std::error::Error>> {
    let config = SmtpConfig::from_env()?;

    let from = Mailbox::new(Some("Rust SMTP Utils".into()), config.username.parse()?);
    let to = Mailbox::new(None, "admin@example.com".parse()?);
    let reply_to = Mailbox::new(None, "user@example.com".parse()?);

    send_text_email(
        &config,
        from,
        to,
        "Test email".into(),
        "Hello from rust_smtp_utils".into(),
        Some(reply_to),
    )?;

    Ok(())
}