I have my file mail.php :
Try this:
Open the php.ini
.
Search for the attribute called SMTP
in the php.ini file. Generally you can find the line SMTP=localhost
. change the localhost to the smtp server name of your ISP. And the set the port of 25.
SMTP = smtp.gmail.com #user your smtp address here
smtp_port = 25
Restart the apache server or wamp or xammp. Whatever you are using.
Now try to send the mail using the mail() function