[Tutor] SMTPLIB Exception Object

Dave Angel davea at davea.name
Wed Apr 23 11:22:11 CEST 2014

Hobie Audet <Hobie.Audet at comcast.net> Wrote in message:

It would be much better if you used text emails to post on this
 text list, rather than html. For one thing,  your indentation
 might not be messed up.  For another,  I might be able to do
 proper quoting. 

(you wrote):

 My code looks something like this:

        server = smtplib.SMTP(name,port)
         server.login(userid, password)
             server.sendmail(fromline, tolist, msg) 
          except smtplib.SMTPRecipientsRefused:
              (here's where I need to access the recipients attribute)

Use copypaste,  as when you retype,  it's likely you'll mess up

You don't save the exception object.  Try

   except smtplib.SMTPRecipientsRefused as excep:

If that doesn't get you going,  then please tell us what Python


More information about the Tutor mailing list