$to = $_POST['address'];
$subject = "Email from websitename.com";
$name = $_POST['name'];
$headers = "From: email@example.com";
$message = "If you are able to view this message, then your request for a confirmatory email was successful.\n \t <a href='http://localhost/phpmyresources/addacc.php'>Click here to register yourself</a>";
$body = "Hello $name \n\n\t $message";
mail($to, $subject, $body, $headers);
<br>Email sent <br><br><a href="send_email.php">Back</a>
But the output says mail sending failed, what to do?
Wildhoney is correct; you'll need to identify an SMTP server within the php.ini file, because Windows does not come with a built-in mail server. However, to minimize the hassle I suggest using the PEAR Mail package (http://pear.php.net/package/Mail) as it allows you to pass along other authentication information which is often required by mail servers to prevent spamming. For instance you could easily use the Mail package to authenticate to Gmail and send email through your Gmail account.
I read an article just a couple of days ago about setting up a simple mail server on your own machine to test out PHPs mail functions. I'm drawing a blank now on what server was used. I'll see if I can find it for you.