Crates.io | async-smtp |
lib.rs | async-smtp |
version | |
source | src |
created_at | 2019-11-11 17:53:31.348826 |
updated_at | 2024-12-03 07:02:51.650543 |
description | SMTP client |
homepage | https://github.com/async-email/async-smtp |
repository | https://github.com/async-email/async-smtp |
max_upload_size | |
id | 180327 |
Cargo.toml error: | TOML parse error at line 18, column 1 | 18 | autolib = false | ^^^^^^^ unknown field `autolib`, expected one of `name`, `version`, `edition`, `authors`, `description`, `readme`, `license`, `repository`, `homepage`, `documentation`, `build`, `resolver`, `links`, `default-run`, `default_dash_run`, `rust-version`, `rust_dash_version`, `rust_version`, `license-file`, `license_dash_file`, `license_file`, `licenseFile`, `license_capital_file`, `forced-target`, `forced_dash_target`, `autobins`, `autotests`, `autoexamples`, `autobenches`, `publish`, `metadata`, `keywords`, `categories`, `exclude`, `include` |
size | 0 |
Based on the great lettre library.
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(())
}
Licensed under either of
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.