I have been using class.phpmailer.php script for sending mail from localhost without smtp server.
Everytime i try to send mail from my localhost then following error is generated:

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:\Program Files\Apache Software Foundation\Apache2.2\htdocs\send email\not working scripts\class.phpmailer.php on line 213
there was a problem sending this mail! Could not instantiate mail function.

in my php.ini SMTP is set to localhost and smtp_port is set to 25 without ";"

when using gmail smtp server with the same settings in php.ini then evrything works perfectly alright but this error is generated when not using smtp server.

Problem is that when i'm not connecting to SMTP server then why there is need to verify settings in php.ini

link: php mailer script @ http://phpmailer.sourceforge.net

Please anyone give solution to my problem.

Thanks.

Unless you have a mailserver running on localhost, port 25, PHP cannot send emails. You either need to change the SMTP ports or mail function.
SMTP remotely connects to a remote mail server, allowing you to email from it.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.