warning: Creating default object from empty value in /home/nbilyk/ on line 34.

Sending email from localhost with php

A lot of developers set up PHP on their local machine to test server side development. Here's a little trick how to be able to send email from localhost so you can test email without any difficulty.

Note: This only works when sending email to google hosted email addresses.

1. Go to your php.ini file and change SMTP = localhost to SMTP = and uncomment sendmail_from and put in your sending gmail address.

2. Go to cmd and type iisreset

3. In php, test it with mail("[youremail]", "subject", "body");

Syndicate content