How to Send Email from Localhost XAMPP

Send Email from localhost XAMPP is the most common question that every php beginner ask. There are lots of tutorial on net which provide solution for this problem. But still lots of php beginners are unable to get the correct answer.

Your localhost XAMPP has the ability to send email but by default this functionality is disabled. So I am going to show you how to enable send email functionality on XAMPP. I am writing whole procedure in steps.

I will be working on 2 files that are php.ini, normally located in xampp\php\php.ini and sendmail.ini that is located on xampp\sendmail\sendmail.ini

Also read


Let’s start

1) Open php.ini file. Shortcut way is go to xampp control panel. Click on Config button that is next to Apache and then click PHP (php.ini).

2) Find [mail function] and change SMTP, smtp_port, sendmail_from and sendmail_path to the below code.

3) Now go to xampp\sendmail\sendmail.ini file and change smtp_server, smtp_port, error_logfile, debug_logfile, auth_username, auth_password, force_sender.

Change SMTP, Port, email and password according to your need. You can also use google SMTP setting to send emails from your localhost.

 

Posted in PHP

Author: Ahsan Zameer

I am a web developer and love to search new stuff on web. Trying different approaches and ideas to make web developing more interesting and enjoyable.