From 10c65059686ff74fc2ce412572e2d6fc3497c43a Mon Sep 17 00:00:00 2001 From: Dessalines Date: Wed, 22 Jan 2020 20:35:20 -0500 Subject: [PATCH] Adding correct hello_name to mail. --- server/src/lib.rs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/server/src/lib.rs b/server/src/lib.rs index 4f5554fa2..a9bd5dac7 100644 --- a/server/src/lib.rs +++ b/server/src/lib.rs @@ -105,7 +105,7 @@ pub fn send_email( let mut mailer = SmtpClient::new_simple(&email_config.smtp_server) .unwrap() - .hello_name(ClientId::Domain("localhost".to_string())) + .hello_name(ClientId::Domain(Settings::get().hostname.to_owned())) .credentials(Credentials::new( email_config.smtp_login.to_owned(), email_config.smtp_password.to_owned(), @@ -117,6 +117,8 @@ pub fn send_email( let result = mailer.send(email.into()); + mailer.close(); + match result { Ok(_) => Ok(()), Err(_) => Err("no_email_setup".to_string()),