I am trying to send mail from localhost. but i am unable to send the mail from localhost so can anybody tell me that how to reconfigure my xampp to send mail from localhost
As in my personal experience I found that very similar thing to Vikas Dwivedi answer will work just fine.
Step 1 (php.ini file)
In php.ini file located in xampp\php\php.ini
. Change settings to the following:
extension=php_openssl.dll
[mail function]
sendmail_path =":\xampp7\sendmail\sendmail.exe -t"
mail.add_x_header=On
Turn off other variables under mail funciton
by putting ;
before them. e.g ;smtp_port=25
Step 2 (sendmail.ini file)
In sendmail.ini located in xampp\sendmail\semdmail.ini change to the following:
smtp_server=smtp.gmail.com
smtp_port=465
smtp_ssl=auto
auth_username=address@gmail.com
auth_password=YourPassword
Step 3 (code)
Create a php file and use the following:
Notice