Hi guys,
I am trying to implement a password reset functionality on my company website where if a user needs to reset her password, she can click on a link and a new, randomly generated password will be sent to her inbox.
I am using the PHP mail()
function. Now, I am running PHP5 on an Ubuntu machine. In php.ini I have declared SMTP as the IP of the machine running the mail server and smtp_port as 25. Further, I have tried to telnet into the mailserver on port 25 and send a mail - it works (my work terminal is Windows).
The problem is that the mail is not being sent / received - the PHP script calling mail()
hangs for about 1 minute at the end of which mail()
returns true
.
The worst part is that I am out of ideas on how to even find out where the problem lies - with PHP, with Ubuntu, with the mailserver or with the code!
Can somebody please help?