--- a/UI/EmailDialog.py Mon May 09 20:00:59 2011 +0200 +++ b/UI/EmailDialog.py Thu May 12 19:56:12 2011 +0200 @@ -285,10 +285,16 @@ server.login(Preferences.getUser("MailServerUser"), password) except (smtplib.SMTPException, socket.error) as e: + if isinstance(e, smtplib.SMTPResponseException): + errorStr = e.smtp_error.decode() + elif isinstance(e, socket.error): + errorStr = e[1] + else: + errorStr = str(e) res = E5MessageBox.retryAbort(self, self.trUtf8("Send bug report"), self.trUtf8("""<p>Authentication failed.<br>Reason: {0}</p>""") - .format(str(e)), + .format(errorStr), E5MessageBox.Critical) if res: return self.__sendmail(msg) @@ -302,10 +308,16 @@ QApplication.restoreOverrideCursor() except (smtplib.SMTPException, socket.error) as e: QApplication.restoreOverrideCursor() + if isinstance(e, smtplib.SMTPResponseException): + errorStr = e.smtp_error.decode() + elif isinstance(e, socket.error): + errorStr = e[1] + else: + errorStr = str(e) res = E5MessageBox.retryAbort(self, self.trUtf8("Send bug report"), self.trUtf8("""<p>Message could not be sent.<br>Reason: {0}</p>""") - .format(str(e)), + .format(errorStr), E5MessageBox.Critical) if res: return self.__sendmail(msg)