OS X ships with a postfix install. It's very easy to set it up to relay to a trusted SMTP server over SASL. This is great for sending mail when offline; it just flushes when you're online.
Mail.app will never allow you to use localhost for SMTP. It will not allow 127.x.y.z, localhost, or any name for the local box. It *will* allow it for your IMAP server. What. The. Hell? -- rjbs