Wednesday, November 26, 2014

how to configure xampp to send mail in php?

In order to send mail, you have to make some changes in your files if you are using XAMPP. Configure two files, first one is C:\xampp\php\php.ini and the second one is c:\xampp\sendmail\sendmail.ini

In C:\xampp\php\php.ini find extension=php_openssl.dll and remove the semicolon from the beginning of that line to make SSL working for mailing sites like gmail for your localhost.

In php.ini file find [mail function] and change
sendmail_from =
sendmail_path = "\"C:\xampp\sendmail\sendmail.exe\" -t"

Now Open C:\xampp\sendmail\sendmail.ini. Replace all the existing code in sendmail.ini with following code


Note: Replace gmail-id and gmail-password in above code with yours.

Note: If you are unable to send mail using your gmail accout then you need to make some changes in your gmail account setting like change Access for less secure apps must be enable. Login into your gmail accout and follow the link Gmail setting for less secure apps to configure your gmail account setting.

Click here to get code to send mail using php