Warning: mail() [function.mail]: Failed to connect to mailserver at "localhost" port 25, verify your "SMTP" and "smtp_port" setting in php.ini or use ini_set() in C:\xampplite\htdocs\online\test2.php on line 27

do you have a pop smtp server installed on localhost?

No....i am trying this on my local machine xp. But i am facing this error. Please can you tell me what are the procedures to follow before using mail() on windows xp machine by local host. Please help me out

without a mail server you cant send mail

Check these links:

- http://glob.com.au/sendmail/ (fake sendmail for windows)
- http://www.blat.net/

Maybe you can configure your php.ini to work with this sendmail for Windows, just point the right path and do some tests. With Blat you can't use mail(), you should read the command line usage and use functions like exec() or system(), a simple example:

<php
if(file_exists('message.txt'))
{
exec('blat message.txt -to recipient@email.tld -from your@email.tld');
}
?>