Index: smtplib.py =================================================================== --- smtplib.py (revision 1137) +++ smtplib.py (working copy) @@ -325,7 +325,14 @@ print>>stderr, 'send:', repr(str) if hasattr(self, 'sock') and self.sock: try: - self.sock.sendall(str) + while True: + chunk = str[:0xffff] + str = str[0xffff:] + while chunk: + sent = self.sock.send(chunk) + chunk = chunk[sent:] + if not str: + break except socket.error: self.close() raise SMTPServerDisconnected('Server not connected')