use mail_builder::MessageBuilder;
use mail_send::SmtpClientBuilder;
#[tokio::main]
async fn main() {
let message = MessageBuilder::new()
.from(("John Doe", "john@example.com"))
.to("jane@example.com")
.subject("Hello, world!")
.text_body("Hello, world!")
.attachment("image/png", "kittens.png", [1, 2, 3, 4].as_ref());
SmtpClientBuilder::new("mail.smtp2go.com", 2525)
.unwrap()
.implicit_tls(false)
.connect()
.await
.unwrap()
.send(message)
.await
.unwrap();
}