소스 검색

Authentication is only applied when both the username and password have values. (#2937)

Leo Q 1 년 전
부모
커밋
cc754122fc
1개의 변경된 파일1개의 추가작업 그리고 1개의 파일을 삭제
  1. 1 1
      api/libs/smtp.py

+ 1 - 1
api/libs/smtp.py

@@ -16,7 +16,7 @@ class SMTPClient:
         smtp = smtplib.SMTP(self.server, self.port)
         if self._use_tls:
             smtp.starttls()
-        if (self.username):
+        if self.username and self.password:
             smtp.login(self.username, self.password)
         msg = MIMEMultipart()
         msg['Subject'] = mail['subject']