On 23/04/14 04:35, Hobie Audet wrote:

documentation has me confused.  Specifically, the documentation on the
SMTPRecipientsRefused exception says:

    All recipient addresses refused. The errors for each recipient are
    accessible through the attribute recipients,...

But where is the "recipients" attribute?  More specifically, what is it
an attribute of?

Since its talking about the exception I'd assume its an attribute
of the exception object.

try:
   server.sendmail(fromline, tolist, msg)
except smtplib.SMTPRecipientsRefused:

But you are not fetching the exception object so you need to change your except line to be (assuming Python v3):

except smtplib.SMTPRecipientsRefused as err:

Now you can access err.recipients

HTH
--
Alan G
Author of the Learn to Program web site
http://www.alan-g.me.uk/
http://www.flickr.com/photos/alangauldphotos

_______________________________________________
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
https://mail.python.org/mailman/listinfo/tutor

Reply via email to