This. If the login details were working before then it is some other problem.If you know your settings were working before, try a reboot before changing anything.
If you need to re-enter details manually then ok.
I have only ever had problems when agreeing to the automated 'Repair settings?' box (iOS more than OS X).