My Account | Buy CometChat

documentation

sendChatroomMessage()

sendChatroomMessage() allows you to dynamically send messages to a particular chatroom.

The API

sendChatroomMessage($chatroomID,$message);

Sample Code

You can find out the chatroom ID from CometChat Administration Panel -> Chatrooms. A sample use would be to post a message on behalf of the user in a chatroom.

include_once (cometchat/cometchat_init.php);
sendChatroomMessage ('1',"I love this site! I have already donated, have you?");