Hi,
I've taken a simple emailer off w3schools:
<?php
$to = "$email";
$subject = "Test mail";
$message = "Hello! This is a simple email message.";
$from = "someonelse@example.com";
$headers = "From: $from";
mail($to,$subject,$message,$headers);
echo "Mail Sent.";
?>
That should work, just change the above text to what you want to use.
Also i see that after your INSERT query you sending out the email to the user.
What i would do is move the emailing function further down your script and place it here:
#
//Check whether the query was successful or not
#
if($result) {
// PUT EMAIL FUNCTION HERE -------- ****
header("location: register-success.php");
#
exit();
#
}
Because that way it will only send out the email if the information was inserted correctly into the database.
At current if it were working you would be sending out an email regardless of whether the information got inserted correctly or not.
I think that's right, i'm not a php guru so apologies if i do get it wrong, but above code should work for you.
Regards,
Dan.