当前位置: 首页 > 工具软件 > XMPPHP > 使用案例 >

XMPPHP向OPENFIRE发送message提示成功却无法收到的问题

邹俊友
2023-12-01

  按照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('someguy@someserver.net', 'This is a test message!');
$conn->disconnect();
?>
 此段PHP代码执行后,显示的可能是  no error messages, no warnings , everything says the message has been sent.

但是服务器实际上没有收到。 一种可能的原因是由于加密导致的,因此要关闭加密:

$conn->useEncryption(false);

加入此行代码后即可成功发送消息

 类似资料: