Hi all,
I have a simple contact info form written which when submitted sends the info to a php script which is supposed to then email on the details. The problem is that I can't seems to get the mail function to work correctly. I have php running on iis7 and have configured smtp email as per the windows website. When I tried running the following scripts it produces an error!

`<?php

if(mail('franklenehantesting@gmail.com', 'Test email from localhost', 'This works great!!'))
    echo 'Mail Sent';
else
    echo 'Error, something is wrong.';

?>`

Could anybody please shed some light on this situation for me, as I'm kinda at a lose at the moment!?

An important part to include in this would be the error message you're seeing.

Make sure the smtp settings are correct/enabled in your php.ini file as well.

Got it sorted, didn't have iis6 services setup correctly.

Good to hear, thanks for letting us know.
Make sure to mark the thread solved ;-)