Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

kk_james's avatar

php script does not submit to my email

am having html form with name , email and message and i want when someone fills in the details and press submit, the info goes to my email. But when i tried it i got an error

Warning: 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\forms\script.php on line 18

here is my html doc

Enter Name:

Enter Email Address:

Enter Message:

the php file

0 likes
1 reply
LetherMade's avatar

Hi @kk_james , It looks like your local environment has no SMTP configuration to send mail. For local development I use Helo it is a tool to catch mail and see information about that sended mail. You also have online tools like https://mailtrap.io/ etc.

Please or to participate in this conversation.