UI/EmailDialog.py

changeset 5443
3ef014765648
parent 5389
9b1c800daff3
child 5471
3ad8620b828b
equal deleted inserted replaced
5442:43d42a54cf50 5443:3ef014765648
279 279
280 @param msg the message to be sent (string) 280 @param msg the message to be sent (string)
281 @return flag indicating success (boolean) 281 @return flag indicating success (boolean)
282 """ 282 """
283 try: 283 try:
284 server = smtplib.SMTP(Preferences.getUser("MailServer"), 284 encryption = Preferences.getUser("MailServerEncryption")
285 Preferences.getUser("MailServerPort")) 285 if encryption == "SSL":
286 if Preferences.getUser("MailServerUseTLS"): 286 server = smtplib.SMTP_SSL(
287 server.starttls() 287 Preferences.getUser("MailServer"),
288 Preferences.getUser("MailServerPort"))
289 else:
290 server = smtplib.SMTP(
291 Preferences.getUser("MailServer"),
292 Preferences.getUser("MailServerPort"))
293 if encryption == "TLS":
294 server.starttls()
288 if Preferences.getUser("MailServerAuthentication"): 295 if Preferences.getUser("MailServerAuthentication"):
289 # mail server needs authentication 296 # mail server needs authentication
290 password = Preferences.getUser("MailServerPassword") 297 password = Preferences.getUser("MailServerPassword")
291 if not password: 298 if not password:
292 password, ok = QInputDialog.getText( 299 password, ok = QInputDialog.getText(

eric ide

mercurial