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

Recommended Answers

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

Jump to Post

All 4 Replies

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 1.20 million developers, IT pros, digital marketers, and technology enthusiasts learning and sharing knowledge.