I made a similar reply in another thread - reposted here, hoping it will help.
Your problem might be with your ISP mail server, but it could be a problem with Mail (the iMac email client). My wife and I have used our iMacs for about two years, and there have been repeated problems with Mail "losing" the ISP outgoing mail server connections (and sometimes the incoming server connection as well). Many calls to the Apple Care rep ensued. The fix was usually to delete the account completely, then re-enter the email account from scratch, including the outgoing and incoming mail server addresses.
Early on in the experience, we were told by the Apple rep that our "me.com" accounts were "hijacking" the other email accounts. We completely deleted the me.com (MobilMe) accounts, and this cleared up the problem for a while. The problem has occurred occasionally since then, but much less frequently. MobilMe was a complete waste of money, in my opinion. I hope that Apple's new iCloud is better.
There may be one (or several) bug(s) in Mail, so try completely deleting your email account and re-entering it to see if that will help. You will need to re-enter the outgoing and incoming mail server addresses as well as the password, of course.
Randy