Skip to content

Commit 7b6ec86

Browse files
committed
From field fix
1 parent 972f2c9 commit 7b6ec86

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

email/1.3.0/src/app.py

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -99,10 +99,13 @@ def send_email_smtp(self, smtp_host, recipient, subject, body, smtp_port, attach
9999
try:
100100
s.login(username, password)
101101
except smtplib.SMTPAuthenticationError as e:
102-
return {
103-
"success": False,
104-
"reason": f"Bad username or password: {e}"
105-
}
102+
if len(password) == 0:
103+
self.logger.info("No password provided. Continuing as auth may not be necessary.")
104+
else:
105+
return {
106+
"success": False,
107+
"reason": f"Bad username or password: {e}"
108+
}
106109

107110
if body_type == "" or len(body_type) < 3:
108111
body_type = "html"

0 commit comments

Comments
 (0)