Fixed email sender validation

This commit is contained in:
Donald Zou 2025-07-24 23:12:21 +08:00
parent 042160e6bd
commit 722cbb6054

View File

@ -33,7 +33,7 @@ class EmailSender:
return self.DashboardConfig.GetConfig("Email", "send_from")[1]
def ready(self):
return len(self.Server()) > 0 and len(self.Port()) > 0 and len(self.Encryption()) > 0 and len(self.Username()) > 0 and len(self.Password()) > 0 and len(self.SendFrom())
return all([self.Server(), self.Port(), self.Encryption(), self.Username(), self.Password(), self.SendFrom()])
def send(self, receiver, subject, body, includeAttachment = False, attachmentName = ""):
if self.ready():