This commit is contained in:
Anshuman Saini 2025-06-03 14:08:48 +05:30 committed by GitHub
parent 36f1b4b222
commit e40e9db39a
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -28,7 +28,8 @@ class SMTPClient:
else:
smtp = smtplib.SMTP(self.server, self.port, timeout=10)
if self.username and self.password:
# Only authenticate if both username and password are non-empty
if self.username and self.password and self.username.strip() and self.password.strip():
smtp.login(self.username, self.password)
msg = MIMEMultipart()