I did a new search for a PM System written in PHP.
I actually found a good PM Class written as a mini tutorial:
http://www.pixel2life.com/publish/tutorials/608/simple_private_messaging_system/
The Author is Christian Weber and call himself Balor
The code is very good. Even if it is very barbone (no layouts added).
It is written 2007 September so it should work with PHP 5.
What you must add or have before you install this little script
is a User Login script. But I suppose most of us have this
or you can find them even here at phpbuilder.com in many topics.
Here is the "CREATE TABLE" SQL for this
Simple Private Messaging System
It is most probably intended for MySQL (MyISAM)
CREATE TABLE `messages` (
`id` INT( 11 ) NOT NULL AUTO_INCREMENT PRIMARY KEY ,
`title` VARCHAR( 255 ) NULL
`message` TEXT NOT NULL ,
`from` INT( 11 ) NOT NULL ,
`to` INT( 11 ) NOT NULL ,
`from_viewed` BOOL NOT NULL DEFAULT '0',
`to_viewed` BOOL NOT NULL DEFAULT '0',
`from_deleted` BOOL NOT NULL DEFAULT '0',
`to_deleted` BOOL NOT NULL DEFAULT '0',
`from_vdate` DATETIME NULL ,
`to_vdate` DATETIME NULL ,
`from_ddate` DATETIME NULL ,
`to_ddate` DATETIME NULL ,
`created` DATETIME NOT NULL
) ENGINE = MYISAM ;