This will be a quick tutorial that will show you how to enable e-mail function in PHP on Windows.
What Will You Need?Top
There are few things you need to get before you can continue.
Set Up SendmailTop
After you’ve downloaded sendmail.zip and sendmail-SSL.zip, extract both zip files into same folder and place it somewhere (in my example, location is C:\Program Files\wamp\bin\sendmail). After that open sendmail.ini and change settings like this.
smtp_server=smtp.gmail.com smtp_port=587 smtp_ssl=tls auth_username=(account addres that you created) auth_password=(password of that account)
Change php.iniTop
Open php.ini and find mail function section. There you’ll comment lines that contain SMTP and smtp_port. Then you’ll uncomment line that has sendmail_path and add path to sendmail.exe so you’ll have something like this.
;SMTP = smtp.example.com ;smtp_port = 25 sendmail_path = "C:\Program Files\wamp\bin\sendmail\sendmail.exe"
ConclusionTop
This is a simple way to enable PHP’s mail() function on Windows. I tested this method on Windows 7 but it should work also on XP and Vista. Thank you for reading.