My Account | Buy CometChat

documentation

sendMessage()

sendMessage() function assists you to send a message on behalf of the logged in user to another user.

The API

The input parameter is user’s ID to whom the message wants to be sent along with the message.

jqcc.cometchat.sendMessage('id','message');

Sample Code

You may want to ping another user from a webpage:

<a href="javascript:void(0)" onclick="javascript:jqcc.cometchat.sendMessage('44','PING!!!');">Ping This User</a>