fix in smtp and split rs files
This commit is contained in:
+2
-2
@@ -20,7 +20,7 @@ use lettre::{
|
||||
use rand_core::{OsRng, RngCore};
|
||||
use serde::{Deserialize, Serialize};
|
||||
use sha2::{Digest, Sha256};
|
||||
use sqlx::{any::AnyRow, Row};
|
||||
use sqlx::{Row, any::AnyRow};
|
||||
use tracing::{debug, info, warn};
|
||||
|
||||
use crate::{
|
||||
@@ -2113,7 +2113,7 @@ async fn send_message(smtp: &SmtpConfig, message: Message, label: &str) -> Resul
|
||||
}
|
||||
.port(smtp.port);
|
||||
|
||||
if !smtp.username.is_empty() {
|
||||
if !smtp.username.trim().is_empty() && !smtp.password.is_empty() {
|
||||
builder = builder.credentials(Credentials::new(
|
||||
smtp.username.clone(),
|
||||
smtp.password.clone(),
|
||||
|
||||
Reference in New Issue
Block a user