Jump to content
Larry Ullman's Book Forums

Stuck Already :( Won'T Receive Email -> Chapter 18


Recommended Posts

Hi Larry and other developers.

 

I really hope someone can help me.

 

I'm trying to do chapter 18 (I have read through the whole book but this is the first time I'm tried to do some of the code).

 

I've installed xampp, started mercury (set up a new user) but that's all the mercury config I've done to mercury and xampp. I followed Larry's install guide from peachpits website (but didn't notice anything on mercury setup).

 

I'm using php version 5.4.4.

 

I'm very new to php though. So this is probably something really simple that I've missed or don't know about.

 

In chapter 18 I'm on the register.php. I click submit at first I didn't see anything just a white space. So I commented out the first exit() and now I get the "thank you for registering" (data goes into the DB) but I don't get my email (my email addy is valid and I've checked spam etc

 

Does anyone know what I've missed or what I can do to debug further?

 

 



...
if (mysqli_affected_rows($dbc) == 1) {
$body = "Thank you for registering \n\n
You need to activate your account, Please click the following link to complete the registration process \n\n";
$body .= BASE_URL . 'activate.php?x=' . urlencode($e) . "&y=$a";
mail($trimmed['email'],'Registration', $body, 'From: online@xx.co.uk');
// exit(); //commented this out as I wasn't seeing the below text

echo '<h3>Thank you for registering! A confirmation Email has been sent to your email address. Please click on the link in that email in order to active your account and access all the exclusive content!<h3>';
include ('includes/footer.html');
exit();
...

 

Really appreciate anyones/everyone help. So many thanks in advance,

 

Regards, Alan

Link to comment
Share on other sites

Sorry everyone, I've looked further (and found Larry's comment on page 330!). It appears that on xampp the messages are sent to a folder by default /xampp/mailoutput and setting up mercury seems a bit involved!. I just got confused as I tried wamp before and that sent emails happily with no config. As long as I can see these emails I'm happy! (just have to worry when I put this live and I then don't receive an email!).

 

Sorry to spam the forums though.

 

Brilliant book though Larry. Lately I've read 2 or 3 web languages and all have been useless. This book is perfect though. All the information I need and at the perfect pace!

 

You should knighted!

Link to comment
Share on other sites

 Share

×
×
  • Create New...