From c1d520634a25fac5dea41f3af70273fc0b3a11ae Mon Sep 17 00:00:00 2001 From: Antoine Pitrou Date: Sat, 7 May 2011 19:39:37 +0200 Subject: Issue #11927: SMTP_SSL now uses port 465 by default as documented. Patch by Kasun Herath. --- Lib/smtplib.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'Lib/smtplib.py') diff --git a/Lib/smtplib.py b/Lib/smtplib.py index a01a184c9f..2c2141b167 100755 --- a/Lib/smtplib.py +++ b/Lib/smtplib.py @@ -219,6 +219,7 @@ class SMTP: ehlo_msg = "ehlo" ehlo_resp = None does_esmtp = 0 + default_port = SMTP_PORT def __init__(self, host='', port=0, local_hostname=None, timeout=socket._GLOBAL_DEFAULT_TIMEOUT): @@ -234,7 +235,6 @@ class SMTP: """ self.timeout = timeout self.esmtp_features = {} - self.default_port = SMTP_PORT if host: (code, msg) = self.connect(host, port) if code != 220: @@ -749,13 +749,15 @@ if _have_ssl: are also optional - they can contain a PEM formatted private key and certificate chain file for the SSL connection. """ + + default_port = SMTP_SSL_PORT + def __init__(self, host='', port=0, local_hostname=None, keyfile=None, certfile=None, timeout=socket._GLOBAL_DEFAULT_TIMEOUT): self.keyfile = keyfile self.certfile = certfile SMTP.__init__(self, host, port, local_hostname, timeout) - self.default_port = SMTP_SSL_PORT def _get_socket(self, host, port, timeout): if self.debuglevel > 0: print('connect:', (host, port), file=stderr) -- cgit v1.2.1