messages/email_.py
def _get_session(self):
        """Start session with email server."""
        if self.port in (465, "465"):
            session = self._get_ssl()
        elif self.port in (587, "587"):
            session = self._get_tls()

        try:
            session.login(self.from_, self._auth)
        except SMTPResponseException as e:
            raise MessageSendError(e.smtp_error.decode("unicode_escape"))

        return session
def _get_session(self):
        """Start session with email server."""
        if self.port in (465, "465"):
            session = self._get_ssl()
        elif self.port in (587, "587"):
            session = self._get_tls()

        try:
            session.login(self.from_, self._auth)
        except SMTPResponseException as e:
            raise MessageSendError(e.smtp_error.decode("unicode_escape"))

        return session
Start session with email server.