I'm writing a script for registration to a message board, I know I've said this a dozen times but at least each time has a different question 🙂 . This time I added to the script where when the user registers it emails him a welcome message this his information. I'm trying to run this on a local machine. I'm getting an error when I run the script dealing with the mail() function, I am online when I try this. Is this a problem with my coding or is it not possible on a local Apache server?
Here's the error:
Warning: Failed to Connect in c:\program files\apache group\apache\htdocs\xboard\register.php on line 141
function email() {
$msg = "Thanks for registering! You'll now be able to post and reply to messages. Below is your account information, please keep it for your records.\n";
$msg = "User Name: \t$user_name\n";
$msg = "Password: \t$user_password\n\n";
$msg = "Thanks again for joining! I hope you enjoy Xboard 1.0!\n\n\n\n";
$msg = "Best Regards,\n";
$msg = "The Xboard Team\n";
$to = "$user_email";
$subject = "Xboard 1.0 Registration";
$mailheaders = "From: Xboard 1.0 Team \n";
$mailheaders = "Reply-To: [email]xboard@hotmail.com[/email]\n\n";
mail($to, $subject, $msg, $mailheaders);
}