Skip to content

Commit 2a52a5e

Browse files
Merge pull request #24 from spebern/master
2 parents 3536818 + 2efd35f commit 2a52a5e

File tree

3 files changed

+5
-5
lines changed

3 files changed

+5
-5
lines changed

examples/smtp.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
use async_smtp::{EmailAddress, Envelope, SendableEmail, SmtpClient, Transport};
1+
use async_smtp::{EmailAddress, Envelope, SendableEmail, SmtpClient};
22

33
fn main() {
44
env_logger::init();
@@ -19,7 +19,7 @@ fn main() {
1919
.unwrap()
2020
.into_transport();
2121
// Send the email
22-
let result = mailer.send(email).await;
22+
let result = mailer.connect_and_send(email).await;
2323

2424
if result.is_ok() {
2525
println!("Email sent");

examples/smtp_gmail.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
use async_smtp::smtp::authentication::Credentials;
2-
use async_smtp::{EmailAddress, Envelope, SendableEmail, SmtpClient, Transport};
2+
use async_smtp::{EmailAddress, Envelope, SendableEmail, SmtpClient};
33

44
fn main() {
55
async_std::task::block_on(async move {
@@ -26,7 +26,7 @@ fn main() {
2626
.into_transport();
2727

2828
// Send the email
29-
let result = mailer.send(email).await;
29+
let result = mailer.connect_and_send(email).await;
3030

3131
if result.is_ok() {
3232
println!("Email sent");

src/smtp/smtp_client.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -411,7 +411,7 @@ impl<'a> SmtpTransport {
411411

412412
let client = std::mem::replace(&mut self.client, InnerClient::default());
413413
let ssl_client = client.upgrade_tls_stream(tls_parameters).await?;
414-
std::mem::replace(&mut self.client, ssl_client);
414+
self.client = ssl_client;
415415

416416
debug!("connection encrypted");
417417

0 commit comments

Comments
 (0)