Skip to navigation
Send an email with rust
02.12.22
pub async fn send_email(filename: String) -> String { let mut ret = "".to_string(); let email = Message::builder() .from("Sender
".parse().unwrap()) .to("Receiver
".parse().unwrap()) .subject("Sending email with Rust") .body(String::from("This is my first email")) .unwrap(); let mailer = SmtpTransport::builder_dangerous("192.168.80.2").build(); match mailer.send(&email) { Ok(e) => {ret = "ok".to_string()}, Err(e) => {ret = "failed".to_string()}, } return "ok".to_string(); }
https://www.courier.com/guides/rust-send-email/
Reply
Anonymous
Information Epoch 1742419095
Looking for the ninety percent solution.
Home
Notebook
Contact us