Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.
provide some more details/screenshots of your settings, so we can make sure you're not missing something.
 
My guess is you need to be sure the outgoing server is set to the correct name. For gmail, for example, you need to change the settings within gmail to enable IMAP, and then set the outgoing server within Mail to smtp.gmail.com:username

In general the outgoing mail server will be your email server preceded by "smtp."
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.