You are most probably not running the SMTP server on your localhost.
If you only need the SMTP server for development purposes, and you are running Windows, just install smtp4dev, which can be found on link: http://smtp4dev.codeplex.com/
It is the beautiful little piece of software that sits in the task bar and lets you see all the email that is being sent to it. It doesn't actually send the email anywhere, so you can work with the live data without the fear of spamming someone.
Then, when you want the application to actually send the email (when you run it on a server), you will need the SMTP server address instead of the "localhost".
Lastly if you access the email through the email program, you can probably find a "Outgoing server" in the settings somewhere, although it completely depends on which mail program you use. The "SMTP server" and the "Outgoing server" are exactly ta same thing.