8 releases

0.4.0 Mar 29, 2021
0.3.4 Aug 4, 2020
0.3.3 Jul 30, 2020
0.3.2 Jun 12, 2020
0.1.0 Nov 11, 2019

#10 in Email

Download history 487/week @ 2020-12-24 682/week @ 2020-12-31 1570/week @ 2021-01-07 1002/week @ 2021-01-14 433/week @ 2021-01-21 373/week @ 2021-01-28 266/week @ 2021-02-04 266/week @ 2021-02-11 214/week @ 2021-02-18 191/week @ 2021-02-25 126/week @ 2021-03-04 142/week @ 2021-03-11 224/week @ 2021-03-18 344/week @ 2021-03-25 254/week @ 2021-04-01 404/week @ 2021-04-08

1,870 downloads per month
Used in 5 crates (3 directly)

Apache-2.0/MIT

115KB
3K 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::{
    ClientSecurity, Envelope, SendableEmail, SmtpClient, Transport,
};

async fn smtp_transport_simple() -> Result<()> {
    let email = SendableEmail::new(
        Envelope::new(
            Some("user@localhost".parse().unwrap()),
            vec!["root@localhost".parse().unwrap()],
        )?,
        "id",
        "Hello world",
    );

    // Create a client
    let mut smtp = SmtpClient::new("127.0.0.1:2525").await?.into_transport();

    // Connect and send the email.
    smtp.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.9–6MB
~137K SLoC