Apple Mail client authentication error

Apple Mail client authentication error

My Mail app running on an iMac was working okay but now has an authentication error that prevents it connecting. The error message is 'Unable to verify account name or password'. I have checked all the settings (which were unchanged) and also deleted and reset up the account details but keep getting this message. I can connect to the mailbox successfully using the same credentials on my iPhone.