17 unstable releases

0.10.2 May 13, 2025
0.10.0 Dec 3, 2024
0.9.2 Oct 14, 2024
0.9.1 Apr 1, 2024
0.1.0 Nov 11, 2019

#27 in Email

Download history 2053/week @ 2025-02-19 2452/week @ 2025-02-26 2095/week @ 2025-03-05 2098/week @ 2025-03-12 2389/week @ 2025-03-19 3064/week @ 2025-03-26 2835/week @ 2025-04-02 2249/week @ 2025-04-09 1820/week @ 2025-04-16 2293/week @ 2025-04-23 2538/week @ 2025-04-30 2404/week @ 2025-05-07 2648/week @ 2025-05-14 1517/week @ 2025-05-21 1815/week @ 2025-05-28 1171/week @ 2025-06-04

7,687 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
~166K SLoC