def _get_session(self):
if self.port in (<NUM_LIT>, "<STR_LIT>"):<EOL><INDENT>session = self._get_ssl()<EOL><DEDENT>elif self.port in (<NUM_LIT>, "<STR_LIT>"):<EOL><INDENT>session = self._get_tls()<EOL><DEDENT>try:<EOL><INDENT>session.login(self.from_, self._auth)<EOL><DEDENT>except SMTPResponseException as e:<EOL><INDENT>raise MessageSendError(e.smtp_error.decode("<STR_LIT>"))<EOL><DEDENT>return session<EOL>
Start session with email server.