Php/flash/mysql auto e-mailer

I have an idea but I’m pretty much retarded when it comes to these things so maybe someone can explain. How hard would it be to make a guestbook password protected. What I want is a sign up form containing name, password and e-mail fields. When someone enters a valid e-mail address an e-mail with a random word as a password is sent to them, then they log in and can use the guestbook with that name and password. Is that do-able?

Cheers, J