send_email-0.1.0 has been yanked.
Simple Send Email Client in Rust
Quick Start
To send a email, just provide three structs to send_email function:
use send_email::*;
fn main() {
let sender_info = SenderInfo::new(
"example@gmail.com", "PASSWORD", "Harry Han", SmtpServer::Gmail, "harryhan912@gmail.com",
);
let message = EmailInfo::new(
"Hi", "Hello, this is a test email.", false, vec!["pic.jpg", "Cargo.toml"], );
let recipients = vec![RecipientInfo::new(
"Harry", "y.han@joblist.org.uk", Category::To, )];
send_email(&sender_info, &message, &recipients).unwrap();
}
You can also stores the password in toml file like this and read from it securely:
let sender_info = SenderInfo::new_passwd_from_file(
"example.com", ".password.toml", "Harry Han", SmtpServer::Gmail, );
password = "PASSWORD"
Sending an email is easy as this.