Send email from localhost

Can anyone tell me how to send email from local host using XAMPP server?

The easiest way would be to use either of the following libaries and use an SMTP connection to a Gmail or Hotmail account.

http://swiftmailer.org/Recommended
http://code.google.com/a/apache-extras.org/p/phpmailer/