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

#42 in Email

Download history 2017/week @ 2024-11-15 2573/week @ 2024-11-22 3165/week @ 2024-11-29 1982/week @ 2024-12-06 3127/week @ 2024-12-13 1532/week @ 2024-12-20 1062/week @ 2024-12-27 1976/week @ 2025-01-03 1589/week @ 2025-01-10 1916/week @ 2025-01-17 2106/week @ 2025-01-24 2595/week @ 2025-01-31 2200/week @ 2025-02-07 2049/week @ 2025-02-14 2117/week @ 2025-02-21 1907/week @ 2025-02-28

8,651 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
~176K SLoC