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!


if(mail('franklenehantesting@gmail.com', 'Test email from localhost', 'This works great!!'))
    echo 'Mail Sent';
    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!?

Recommended Answers

All 3 Replies

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 ;-)

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.