XMPPHP向OPENFIRE發送message提示成功卻無法收到的問題

  按照XMPPHP官方的例子

<?php
include("xmpp.php");
$conn = new XMPP('talk.google.com', 5222, 'username', 'password', 'xmpphp', 'gmail.com', $printlog=False, XMPPHP_Log::LEVEL_VERBOSE);
$conn->connect();
$conn->processUntil('session_start');
$conn->message('[email protected]', 'This is a test message!');
$conn->disconnect();
?>
 此段PHP代碼執行後,顯示的可能是 no error messages, no warnings , everything says the message has been sent.

但是服務器實際上沒有收到。 一種可能的原因是由於加密導致的,因此要關閉加密:

$conn->useEncryption(false);

加入此行代碼後即可成功發送消息

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章