diff --git a/server/szurubooru/func/mailer.py b/server/szurubooru/func/mailer.py index c4cf9db..0fe35ac 100644 --- a/server/szurubooru/func/mailer.py +++ b/server/szurubooru/func/mailer.py @@ -13,6 +13,10 @@ def send_mail(sender: str, recipient: str, subject: str, body: str) -> None: smtp = smtplib.SMTP( config.config["smtp"]["host"], int(config.config["smtp"]["port"]) ) + try: + smtp.starttls() + except smtplib.SMTPNotSupportedError: + pass smtp.login(config.config["smtp"]["user"], config.config["smtp"]["pass"]) smtp.send_message(msg) smtp.quit()