use mail_builder::MessageBuilder;
use mail_send::SmtpClientBuilder;
#[tokio::main]
async fn main() {
let message = MessageBuilder::new()
.from(("John Doe", "john@example.com"))
.to(vec![
("Jane Doe", "jane@example.com"),
("James Smith", "james@test.com"),
])
.subject("Hi!")
.html_body("<h1>Hello, world!</h1>")
.text_body("Hello world!");
SmtpClientBuilder::new("smtp.gmail.com", 587)
.unwrap()
.implicit_tls(false)
.credentials(("john", "p4ssw0rd"))
.connect()
.await
.unwrap()
.send(message)
.await
.unwrap();
}