move examples into own directory
This commit is contained in:
20
examples/sendmessage_example.php
Normal file
20
examples/sendmessage_example.php
Normal file
@@ -0,0 +1,20 @@
|
||||
<?php
|
||||
|
||||
// activate full error reporting
|
||||
//error_reporting(E_ALL & E_STRICT);
|
||||
|
||||
include 'XMPPHP/XMPP.php';
|
||||
|
||||
#Use XMPPHP_Log::LEVEL_VERBOSE to get more logging for error reports
|
||||
#If this doesn't work, are you running 64-bit PHP with < 5.2.6?
|
||||
$conn = new XMPPHP_XMPP('talk.google.com', 5222, 'username', 'password', 'xmpphp', 'gmail.com', $printlog=false, $loglevel=XMPPHP_Log::LEVEL_INFO);
|
||||
|
||||
try {
|
||||
$conn->connect();
|
||||
$conn->processUntil('session_start');
|
||||
$conn->presence();
|
||||
$conn->message('someguy@someserver.net', 'This is a test message!');
|
||||
$conn->disconnect();
|
||||
} catch(XMPPHP_Exception $e) {
|
||||
die($e->getMessage());
|
||||
}
|
Reference in New Issue
Block a user