this means the SMTP server is not configured to listen to the address:
mail.localhost
on port 25
What SMTP Server are you using? double check that it is properly configured.
For myself, i don't bother with setting up an SMTP server, i do my local testing through a remote SMTP server.
you may be able to use your hosts SMTP server, or i like to use my Gmail account
you can send through the gmail server by using the address:
ssl://smtp.gmail.com
on port 465
make sure to enable authentication, and use your gmail account details. you may get an email from google about a 3rd party application using your account and you will need to enable 3rd party applications..