Well now, the first thing I have to say is that you need to think about the users' security. So your send password procedure should ask the user for the username and email address they registered with. You then check both of these against their details in the database and only send the password to that email.
- process form input for sql injection attack
- look up details in db for username and verify email address against them
- use mail() function to send email with password
- output message saying 'email sent' or 'wrong email' accordingly
To make things more secure, many sites have an additional check such as 'secret question' in addition to the registration email. Doing this can also allow for users who have changed their email address since registering.