for icq i got some class written by some guy from netherlands - i'm not sure sure whether it is still workin (it calls some pages at mirabilis.com), but give it a try. use it like this:
require_once("icq.inc.php");
$UIN = 1234567890;
$icq = new ICQ();
$icq->setuin($UIN);
$icq->msg('name','name@server.com','ICQ msg test','This is a test');
just change $UIN to the icq number u wanna send a message to and the user should receive the test.
hth