15 releases (8 breaking)

0.10.0 Dec 3, 2024
0.9.2 Oct 14, 2024
0.9.1 Apr 1, 2024
0.9.0 Mar 12, 2023
0.1.0 Nov 11, 2019

#38 in Email

Download history 2989/week @ 2024-12-16 979/week @ 2024-12-23 1415/week @ 2024-12-30 2011/week @ 2025-01-06 1519/week @ 2025-01-13 1858/week @ 2025-01-20 2159/week @ 2025-01-27 2700/week @ 2025-02-03 2347/week @ 2025-02-10 1860/week @ 2025-02-17 2478/week @ 2025-02-24 1737/week @ 2025-03-03 2458/week @ 2025-03-10 2208/week @ 2025-03-17 2692/week @ 2025-03-24 2631/week @ 2025-03-31

10,234 downloads per month
Used in 9 crates (5 directly)

MIT/Apache

78KB
2K SLoC

async-smtp

Async implementation of SMTP


Based on the great lettre library.

Example

pub type Error = Box<dyn std::error::Error + Send + Sync>;
pub type Result<T> = std::result::Result<T, Error>;

use async_smtp::{Envelope, SendableEmail, SmtpClient, SmtpTransport};

async fn smtp_transport_simple() -> Result<()> {
    let stream = TcpStream::connect("127.0.0.1:2525").await?;
    let client = SmtpClient::new();
    let mut transport = SmtpTransport::new(client, stream).await?;

    let email = SendableEmail::new(
        Envelope::new(
            Some("user@localhost".parse().unwrap()),
            vec!["root@localhost".parse().unwrap()],
        )?,
        "Hello world",
    );
    transport.send(email).await?;

    Ok(())
}

License

Licensed under either of

Contribution

Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.

Dependencies

~2–13MB
~178K SLoC