How to send emails from localhost in Xampp / Wamp / Lamp (PHP)

Hi friendz,

PHP mail function is very important one in project development. When we go to use and test this mail(), it would be working great in web servers but in localhost we may face more problems, ok we will test, how to solve this,

here we go,

First in your appache installation folder, check your php folder and inside open php.ini file.

search for a word (sendmail_path) and then you can see like below line code,

;sendmail_path = "\"E:\xampp\sendmail\sendmail.exe\" -t"

make a uncomment that file like below

sendmail_path = "\"E:\xampp\sendmail\sendmail.exe\" -t"

and you can see one more file

;sendmail_path="E:\xampp\mailtodisk\mailtodisk.exe"

dont uncomment the above one, let it be same like this

and then go to sendmail folder in your xampp path and open that folder
inside open that sendmail.ini file

here we use Gmail email configuration for our setup.

in smtp_server set up make it like below

smtp_server=smtp.gmail.com

and smtp_port make it like below

smtp_port=587

and finally one more thing

auth_username=your gmail username
auth_password=your gmail password

that is it guys. restart your apache and mysql, then it will be working sweetly.

Hope you guys get it easily.

 

 

 

Post a Comment

Post a Comment (0)

Previous Post Next Post