13 releases (7 breaking)

0.9.1 Apr 1, 2024
0.9.0 Mar 12, 2023
0.8.0 Feb 3, 2023
0.5.0 Jun 27, 2022
0.1.0 Nov 11, 2019

#16 in Email

Download history 819/week @ 2024-01-18 961/week @ 2024-01-25 1005/week @ 2024-02-01 922/week @ 2024-02-08 596/week @ 2024-02-15 581/week @ 2024-02-22 1060/week @ 2024-02-29 745/week @ 2024-03-07 1041/week @ 2024-03-14 857/week @ 2024-03-21 2146/week @ 2024-03-28 1297/week @ 2024-04-04 1023/week @ 2024-04-11 1211/week @ 2024-04-18 1940/week @ 2024-04-25 1222/week @ 2024-05-02

5,572 downloads per month
Used in 8 crates (4 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–17MB
~186K SLoC