From: Dessalines Date: Thu, 23 Jan 2020 01:35:20 +0000 (-0500) Subject: Adding correct hello_name to mail. X-Git-Url: http://these/git/%7B%60%24%7BwebArchiveUrl%7D/%22%7B%7D/test?a=commitdiff_plain;h=f1b5b50dc8531e08be9b055c709c3381ec540852;p=lemmy.git Adding correct hello_name to mail. --- diff --git a/server/src/lib.rs b/server/src/lib.rs index 4f5554fa..a9bd5dac 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()),