Remove SmtpClient and make transport immutable

in Transport methods. Also make proper use of
connection pools.
This commit is contained in:
Alexis Mousset
2020-05-01 20:51:07 +02:00
parent dfbe6e9ba2
commit 0604030b91
20 changed files with 507 additions and 713 deletions

View File

@@ -1,7 +1,7 @@
extern crate env_logger;
extern crate lettre;
use lettre::{Message, SmtpClient, Transport};
use lettre::{Message, SmtpTransport, Transport};
fn main() {
env_logger::init();
@@ -14,7 +14,7 @@ fn main() {
.unwrap();
// Open a local connection on port 25
let mut mailer = SmtpClient::new_unencrypted_localhost().unwrap().transport();
let mailer = SmtpTransport::unencrypted_localhost();
// Send the email
let result = mailer.send(&email);