Hello,

I am sending a mail on localhost but getting error given below.
Please suggest me solution for that.

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:\xampp\htdocs\project\contact2.php on line 261

I think you can send mail only after uploading the site..We cant send it from localhost..

I guess you ran the file locally using xamp. Give it a try by uploading on a hosting server.

A snippet of your mail code would be great! maybe you're not entering in all the info correctly.

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.