Fix attribute error in SMTPDataError 53/139853/1
authorhyokeun <hyokeun.jeon@samsung.com>
Fri, 21 Jul 2017 00:34:25 +0000 (09:34 +0900)
committerhyokeun <hyokeun.jeon@samsung.com>
Fri, 21 Jul 2017 00:34:25 +0000 (09:34 +0900)
Change-Id: Ia2395b6f224f5597ee857bc629ec87ce845c022d

common/send_mail.py

index 50b1e2f..3c3c4fc 100644 (file)
@@ -69,7 +69,7 @@ def sendmail(from_email, to_who, msg, smtp_server):
         smtp.quit()
         print "Email to %s sent succeeded" % to_who
     except smtplib.SMTPException, smtpe:
-        if 'no valid recipients' in smtpe.recipients.values()[0][1]:
+        if 'no valid recipients' in smtpe:
             raise MailError('Error: unable to send email: %s' % smtpe)
         raise Exception, "Error: unable to send email: %s" % smtpe