I'm a complete beginner and trying to work my way through the Head First book, PHP & MySQL. I'm having a problem in Chapter 1, the final version of the form will not work and is giving this error:

Warning: mail(): Failed to connect to mailserver at &quot;localhost&quot; port 25, verify your &quot;SMTP&quot; and &quot;smtp_port&quot; setting in php.ini or use ini_set() in C:\wamp\www\hf\examples\ch01\final\aliens\report.php on line 30

I think my SMTP isn't set up, I am using Apache, not IIS. I have no idea how to fix this problem and set up the SMTP. I'm not even sure what the problem is. Could anyone please advise me on how to fix this? I'm stuck here and I want to get on with learning PHP.

You probably don't have a mail server setup/running. It's not a big deal, and it's one easily rectified. The easiest thing to do would be to look up instructions for using mail() with a remote smtp server, and then configure your php to use an external server like gmail with an existing account. or you can just say "oh, that's why it doesn't work when i run it locally" and move on to chapter 2. The first is the 'official' answer, the second is the route i chose when faced with the same problem (except was developing locally before pushing to a live site) Rather than waste time making it work locally, i held off on troubleshooting mail until the script was in place with a mail server and working credentials, and then it worked fine.

Thanks for your advice, I appreciate it. I think I will choose the second way, to just ignore it and move on to chapter 2. I will figure out how to set that up later on; you're right, it's not worth making it work locally.