You seem to be lacking some basic knowledge about how e-mail works; installing and configuring a mail server program on your server is not enough, the outside world needs to know how to address and reach it.
In order for your server to receive mail from the Internet, you will need at least a public DNS domain name (like "yourdomain.com"), a public static IP address for your server and a MX record in the DNS zone of your domain stating that the computer at that IP address is the mail server for the domain. Also, your e-mail addresses will be in the format "user@yourdomain.com", so your mail server program will need to be configured accordingly.
"Localhost" is only a private dummy name that refers to the host you are on; you can't use it to identify your server from anywhere else than on the server itself.