Jump to content
Larry Ullman's Book Forums

Recommended Posts

I have been spending several hours trying to troubleshoot the code in Script 13.6 - register.php and can't seem to find the solution. The script won't send the email using the following code:

 

// Send the email.

$body = "Thank you for registering at the User Registration site. To activate your account, please click on this link:\n\n";

$body .= "http://www.mywebsite.com/dispatch/activate.php" .mysql_insert_id() . "&y=$a";

mail($_POST['email'], 'Registration Confirmation', $body, 'From: admin@mywebsite.com');

 

// Finish the page.

echo '<h3>Thank you for registering! A confirmation email has been sent to your address. Please click on the link in that email in order to activate your account.</h3>';

include ('./includes/footer.html'); // Include the HTML footer.

exit();

 

} else { // If it did not run OK.

echo '<p><font color="red" size="+1">You could not be registered due to a system error. We apologize for any inconvenience.</font></p>';

 

 

Can anyone help with ideas on what might be wrong?

 

Thanks.

Share this post


Link to post
Share on other sites

You don't mention a lot of crucial details. Without them it's impossible to help.

Is your site on a remote webhost or being run locally? What OS is the script on? What version of PHP is being used?

 

-matthaus

  • Upvote 1

Share this post


Link to post
Share on other sites

You don't mention a lot of crucial details. Without them it's impossible to help.

Is your site on a remote webhost or being run locally? What OS is the script on? What version of PHP is being used?

 

-matthaus

 

 

Thanks matthaus. I have part of it figured out. Took another look and now it's sending to two out of three emails. May actually be my email client. I'll check.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×