#email #smtp #mailer

samotop-delivery

Set of transports to deliver mail to, notably to SMTP/LMTP, but also maildir

4 releases (2 breaking)

0.12.0 Feb 6, 2021
0.5.0 Nov 21, 2020
0.4.4 Oct 30, 2020
0.4.4-samotop-dev Oct 28, 2020

#47 in Email

26 downloads per month
Used in 2 crates (via samotop)

MIT/Apache

265KB
7K SLoC

samotop-delivery 0.12.0

samotop-delivery is a set of transports to deliver mail to, notably to SMTP/LMTP, but also maildir... It is used in Samotop as a delivery solution for incoming mail.

Example

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

use samotop_delivery::prelude::{
    Envelope, SmtpClient, Transport,
};

async fn smtp_transport_simple() -> Result<()> {
    let envelope = Envelope::new(
            Some("user@localhost".parse()?),
            vec!["root@localhost".parse()?],
            "id".to_string(),
        )?;
    let message = "From: user@localhost\r\n\
                    Content-Type: text/plain\r\n\
                    \r\n\
                    Hello example"
                    .as_bytes();
    let client = SmtpClient::new("127.0.0.1:2525")?;

    // Create a client, connect and send
    client.connect_and_send(envelope, message).await?;

    Ok(())
}

Credits

This is a fork of async-smtp

License - MIT OR Apache-2.0

Licensed under either of Apache License, Version 2.0 or MIT license at your option.
Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in this crate by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.

Dependencies

~2.4–5MB
~97K SLoC