diff --git a/crates/utils/src/email.rs b/crates/utils/src/email.rs index eda8309f8..62cbe3c5e 100644 --- a/crates/utils/src/email.rs +++ b/crates/utils/src/email.rs @@ -78,7 +78,11 @@ pub fn send_email( }; // Set the creds if they exist - if let (Some(username), Some(password)) = (email_config.smtp_login, email_config.smtp_password) { + let smtp_password = std::env::var("LEMMY_SMTP_PASSWORD") + .ok() + .or(email_config.smtp_password); + + if let (Some(username), Some(password)) = (email_config.smtp_login, smtp_password) { builder = builder.credentials(Credentials::new(username, password)); }