is failing. A possible reason for this could be transient conditions. In my experience, dsl connections drop off more than you expect, and you could be trying when you have no connection to the internet?
Try and do some error checking, on the first line of your code, to see if it connects before continuing to authenticate, etc.