I have WordPress (the popular CMS or blogging platform) installed in my local computer/localhost for development and testing purposes.
For the server and database setup I have installed XAMP running in my Windows machine.
So, to run this installation I use the following URL: http://localhost/wordpress/
Now, I need my WordPress installation to send out an email, for example when a comment is posted. Or, if you want to test the “WP Email Capture” plugin in localhost, you are definitely going to need the ability to send email from your local WordPress installation.
By default, WordPress is unable to send any emails when installed in local computer. However, a few small changes can easily enable this feature. This is described below.
To send out emails from your local WordPress installation or localhost, simply follow the steps below:
- Install XAMP (default location is C drive) and WordPress in your local computer (localhost)
- In the sendmail.ini file (C:\xampp\sendmail\sendmail.ini), make the following changes:
- smtp_port=587 (some recommend using smtp_port=25 but for me 587 worked)
Next, make the following change in your php.ini (C:\xampp\php\php.ini) file:
- sendmail_path = “\”C:\xampp\sendmail\sendmail.exe\” -t” (actually you need to enable this line as it is commented by default)
Once the changes have made restart Apache from the XAMP control panel.
And that’s it!
This is all you need to do to send email from your WordPress installation that is in the local computer (localhost). If you have any questions, leave them in the Comments section below and I will try to answer every one of them.