fix logic
This commit is contained in:
parent
abfeafa026
commit
70b8f09ccb
|
@ -221,16 +221,17 @@ class CoreSettings(BaseAuditModel):
|
|||
)
|
||||
server.send_message(msg)
|
||||
server.quit()
|
||||
if self.smtp_host == "smtp-relay.gmail.com" and not self.smtp_requires_auth:
|
||||
# gmail smtp relay specific handling.
|
||||
server.ehlo()
|
||||
server.starttls()
|
||||
server.send_message(msg)
|
||||
server.quit()
|
||||
else:
|
||||
# smtp relay. no auth required
|
||||
server.send_message(msg)
|
||||
server.quit()
|
||||
# gmail smtp relay specific handling.
|
||||
if self.smtp_host == "smtp-relay.gmail.com":
|
||||
server.ehlo()
|
||||
server.starttls()
|
||||
server.send_message(msg)
|
||||
server.quit()
|
||||
else:
|
||||
# smtp relay. no auth required
|
||||
server.send_message(msg)
|
||||
server.quit()
|
||||
|
||||
except Exception as e:
|
||||
DebugLog.error(message=f"Sending email failed with error: {e}")
|
||||
|
|
Loading…
Reference in New Issue