]> Untitled Git - lemmy.git/commitdiff
Adding correct hello_name to mail.
authorDessalines <tyhou13@gmx.com>
Thu, 23 Jan 2020 01:35:20 +0000 (20:35 -0500)
committerDessalines <tyhou13@gmx.com>
Thu, 23 Jan 2020 01:35:20 +0000 (20:35 -0500)
server/src/lib.rs

index 4f5554fa2680e6cfa45c9a6d33ee21ceb99bb4f8..a9bd5dac7d3d2282cfcb77e29e5fded219197917 100644 (file)
@@ -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()),