Roger Beickel Posted July 1, 2012 Share Posted July 1, 2012 Hi larry, I have been able to make all of your lessons work up to chapter 18. Using PHP 5.3.8 on Windows Vista with Xampp 1.7.7 installed. In Chapter 18 when testing on my computer as localhost, The registered user never receives an e-mail to validate his account. My best guess is a possible dissconnect with my e-mail server. I am still rather new to all of this PHP programing so any suggestions you can give would be greatly appreciated. Link to comment Share on other sites More sharing options...
margaux Posted July 1, 2012 Share Posted July 1, 2012 You need to ensure your localhost is configured properly to send emails. If you search online you will find what changes you need to make. 1 Link to comment Share on other sites More sharing options...
Roger Beickel Posted July 3, 2012 Author Share Posted July 3, 2012 I have configured Mercury email and sent numerous test messages as admin@localhost through Mozilla Thunderbird the email messages always get sent. Therefore I don't understand why registered users are not receiving an email confirmation when doing the exercises in Chapter 18. I can only come up with the possibility that all the my confirmation emails are being rejected as spam. Link to comment Share on other sites More sharing options...
Larry Posted July 4, 2012 Share Posted July 4, 2012 You're using Mozilla Thunderbird to send yourself a test email from admin@localhost using Mercury. And that works. What "from" address are you using in PHP? Link to comment Share on other sites More sharing options...
Roger Beickel Posted July 5, 2012 Author Share Posted July 5, 2012 Thanks for your reply. Inside php.ini, I have tried using: sendmail_from = admin@localhost sendmail_from = localhost.com sendmail_from = localhost inside ch18/includes/config.inc.php I have: define('EMAIL', 'admin@localhost'); define('BASE_URL', 'http://localhost/ch18/'); Link to comment Share on other sites More sharing options...
Larry Posted July 7, 2012 Share Posted July 7, 2012 In the php.ini, I would use the "From" address that you know works in Thunderbird. You can play with different "From" addresses in the PHP script, then. Also try different "To" addresses, starting with the one you knew worked from Thunderbird. Link to comment Share on other sites More sharing options...
jabsalud Posted July 15, 2012 Share Posted July 15, 2012 hi sir In the php.ini, I would use the "From" address that you know works in Thunderbird. You can play with different "From" addresses in the PHP script, then. Also try different "To" addresses, starting with the one you knew worked from Thunderbird. hi sir i am having a problem. the activation message which i received in my thunder bird is successful however when i click the generated link "http://www.example.c...29aa192acc379b7" it forwards me to the this site "http://www.iana.org/domains/example/" even though in my script i wrote this "$body .= BASE_URL . 'activate.php?x=' . urlencode($e) . "&y=$a";" what might be the problem? if i cant fix it i think i cant make to it next topic because i cant activate the account created and cant login. Link to comment Share on other sites More sharing options...
Larry Posted July 16, 2012 Share Posted July 16, 2012 You have to use your actual Web site URL. I assume you don't own and run www.example.com. Link to comment Share on other sites More sharing options...
Roger Beickel Posted August 10, 2012 Author Share Posted August 10, 2012 OK, here is where I am at. I found out how to send an email to validate a registered user in Chapter 18. I finally gave up on using windows to send email. So here is some encouragement for those who are still reluctant to attempt the linux operating system. As a newbie, I was able to setup Ubuntu 12.04 on a Windows PC and this is how I set up my computer to send email. First you must install a software package called "Sendmail." -- I let Ubuntu install this package for me. Once you have installed Sendmail, you should test to make sure that it is installed and in working order. To do this go to the Linux Command Prompt and enter the command: $ echo "my sendmail test" | /usr/sbin/sendmail user@remote.host Replace user@remote.host with an actual working email address. Then check to see if a message was sent to that address. It should read "my sendmail test" in the body of the email. Now that you have Sendmail up and running, you will then need to configure your php.ini file to recognize Sendmail. You can find the location of your php.ini file by looking inside your php.info. Before editing your php.ini file. You need to stop your server with this command: /opt/lampp/lampp stop Inside php.ini look for the "Sendmail_path." Then complete the path by typing the following command: Sendmail_path = /usr/sbin/sendmail -t -i restart your server with this command: /opt/lampp/lampp start With any luck, you should now be able to send email using php / mail( ) function. for further discussion on Sendmail and sending email. Consider the following sources: www.php.net/manual/en/mail.configuration.php http://forum.powweb....ead.php?t=38269 Link to comment Share on other sites More sharing options...
Larry Posted August 10, 2012 Share Posted August 10, 2012 Glad you got a solution, Roger, and thanks for sharing so that others might benefit! Link to comment Share on other sites More sharing options...
Recommended Posts