Skip to content

Commit db00025

Browse files
committed
fix SMTP_TLS option
1 parent f6fa5a9 commit db00025

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

index.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -776,10 +776,10 @@ def _sendMail(config, from_addr, to_addr, subject, message):
776776
try:
777777
with smtp(config["SMTP_HOST"], port=config["SMTP_PORT"], timeout=timeout) as server:
778778
if "SMTP_TLS" in config:
779-
connection.ehlo()
779+
server.ehlo()
780780
context = ssl.SSLContext(ssl.PROTOCOL_TLS)
781-
connection.starttls(context=context)
782-
connection.ehlo()
781+
server.starttls(context=context)
782+
server.ehlo()
783783
if "SMTP_USERNAME" in config:
784784
try:
785785
server.login(config["SMTP_USERNAME"], config["SMTP_PASSWORD"])

0 commit comments

Comments
 (0)