Php – How to enable PHP mail() function in a IIS7 / Win2008 server

emailiis-7PHPwindows-server-2008

I have a web server where I currently host an ASP.Net Web Application that uses the IIS6 SMTP Server to send notification emails.

I installed PHP and WordPress using the Web Plataform Installer and installed it as a subdirectory for my website. The blog is working perfectly, but it doesn't send any notification email, and says that the mail() function is not set, even though I correctly application uses.

Is there any other place I need to go to enable the mail function?

Best Answer

Basically, you need to set up these in your php.ini:

[mail function]
SMTP = mail.example.com
sendmail_from = admin@example.com

These work on Win32 and Win64, and let you change mail()'s behavior to run through SMTP. Obviously, you have to have an SMTP server that will let you talk to it.

Mainly this is done because actually integrating a sendmail equivalent on Win32 is a nightmare.