feat(chalice): SMTP allow empty username
This commit is contained in:
parent
54d6636060
commit
c5208bf2c3
1 changed files with 2 additions and 1 deletions
|
|
@ -30,7 +30,8 @@ class SMTPClient:
|
|||
self.server.starttls()
|
||||
# stmplib docs recommend calling ehlo() before & after starttls()
|
||||
self.server.ehlo()
|
||||
self.server.login(user=config("EMAIL_USER"), password=config("EMAIL_PASSWORD"))
|
||||
if len(config("EMAIL_USER", default="")) > 0 and len(config("EMAIL_PASSWORD", default="")) > 0:
|
||||
self.server.login(user=config("EMAIL_USER"), password=config("EMAIL_PASSWORD"))
|
||||
return self.server
|
||||
|
||||
def __exit__(self, *args):
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue