From 03239000e1a44c830f216ed0746686878b12f5e4 Mon Sep 17 00:00:00 2001 From: =?utf8?q?M=C3=A1ty=C3=A1s=20Jani?= Date: Mon, 14 Dec 2015 09:33:12 +0100 Subject: [PATCH] Fix tls bug in python 3.4+ Signed-off-by: Matyas Jani --- rss2email/email.py | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/rss2email/email.py b/rss2email/email.py index e082872..c7df67d 100644 --- a/rss2email/email.py +++ b/rss2email/email.py @@ -145,12 +145,11 @@ def smtp_send(sender, recipient, message, config=None, section='DEFAULT'): server = config.get(section, 'smtp-server') _LOG.debug('sending message to {} via {}'.format(recipient, server)) ssl = config.getboolean(section, 'smtp-ssl') - if ssl: - smtp = _smtplib.SMTP_SSL() - else: - smtp = _smtplib.SMTP() try: - smtp.connect(server) + if ssl: + smtp = _smtplib.SMTP_SSL(host=server) + else: + smtp = _smtplib.SMTP(host=server) except KeyboardInterrupt: raise except Exception as e: -- 2.26.2