How to send and receive message using xmpp in php

877 Views Asked by At
include("xmpp.php");
$conn = new XMPP(
   'talk.google.com',
   5222,
   'username',
   'password',
   'xmpphp',
   'gmail.com',
);
//$conn->use_encryption = false; // Optional
$conn->connect();
$conn->processUntil('session_start');
$conn->message('[email protected]', 'This is a test message!');
$conn->disconnect();

I am trying to send messages using this code but not able to send message.
I also have to receive messages also.
I have wamp server setup

1

There are 1 best solutions below

2
On

Remove last comma , and try like this.

$conn = new XMPP(
'talk.google.com',
5222,
'username',
'password',
'xmpphp',
'gmail.com'
);