I think you'll have to use the mail function. I read about it once on w3schools. You should check it out. By the way, try searching google before you ask for help here. You'll get more help from google than you will from here.
I was wrong about the mail function. A mail system is basically making the table with id, user to, user from, the message and date. Then for mail for the certain user you select from mail where the username=session or cookie. Inserting is pretty simple.