diff -r 3e897eef0fac Lib/smtplib.py --- a/Lib/smtplib.py Wed Mar 02 19:40:50 2016 +0200 +++ b/Lib/smtplib.py Thu Mar 03 14:00:24 2016 +0700 @@ -241,7 +241,6 @@ will be used. """ - self._host = host self.timeout = timeout self.esmtp_features = {} self.command_encoding = 'ascii' @@ -328,6 +327,7 @@ port = int(port) except ValueError: raise OSError("nonnumeric port") + self._host = host if not port: port = self.default_port if self.debuglevel > 0: