Setting up email functionality on WAMP with Gmail account

If you need to send emails from your WAMP server or to test application’s email functionality, there is an easy way to set this up on your Windows machine ( make sure you have gmail account to use for this ). These are necessary steps:

1) Download ‘fake sendmail for windows’ program from here, extract the package and copy ‘sendmail’ folder where you want ( good idea would be folder like C:\wamp\ , so sendmail is located at C:\wamp\sendmail )

2) Open C:\wamp\sendmail\sendmail.ini and edit following lines:

where is your gmail and your_password password for this gmail account.

3) In php.ini ( for wamp path it’s usually something like this C:\wamp\bin\apache\Apache2.4.4\bin ), find sendmail_path line and comment it out by removing ; in front of it. Edit sendmail_path to match location of sendmail.exe like this:

sendmail_path = "C:\wamp\sendmail\sendmail.exe -t"

Save changes, restart Apache and you should be able to use mail() function without problems.

Note: With this setup you will need to specify From header when using mail() function. If you want to have default From field edit force_sender= in sendmail.ini to match default From email address to be used

Read More