Hi,
I want to create a forgotten password page, where the user enters in their email address, the script queries the database for that email address, creates a unique ID, stores that unique ID in the database, then emails the unique ID and the User ID off to the user in an HTML link e.g. http://somesite.com/reset-password.php?userId=2&uniqueId=132832189312978312. The reset page would then match the unique ID to the one in the database and let them enter in a new password into the form.
Ok so I can do most of that so far except from the emailing to the user. I’m running an Ubuntu Server 10 at the moment as my test server which is on my local network. I have set up a generic sendmail service on port 25 on my server but I’d like to do testing with external SMTP servers as well because when the site is running in the hosted live environment as it will likely use their mail servers.
I’ve had a play round with the PHP mail() function but it won’t send anything at the moment for some reason. I’ve been playing with the PEAR mail sending functionality on this example:
http://www.blog.highub.com/javascript/javascript-core/make-ubuntu-php-localhost-mail-function-work/
It actually sends the email and I can get it in my gmail but I get about 50 lines of errors saying:
[php]Strict Standards: Non-static method PEAR::isError() should not be called statically, assuming $this from incompatible context in /usr/share/php/Mail/mimePart.php on line 307
Strict Standards: Non-static method Mail_mimePart::encodeHeader() should not be called statically, assuming $this from incompatible context in /usr/share/php/Mail/mime.php on line 1316
Strict Standards: Non-static method Mail_mimePart::_explodeQuotedString() should not be called statically, assuming $this from incompatible context in /usr/share/php/Mail/mimePart.php on line 827
Strict Standards: Non-static method Mail::factory() should not be called statically in /opt/lampp/htdocs/site/sendmail.php on line 28[/php]
Any idea on how to get this working? Also do many web hosts have PEAR configured on them? I’m a bit dubious about relying on it if most web hosts don’t actually run it.
Many thanks!