Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.
Open Mail and go to the menu item 'Window' and in the drop down select "Connection Doctor". When this opens first select a printout and then try to connect again. The printout will then show you every step Mail is trying to reach the sever. This way you know why it is failing.
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.