正如标题所说,我想将相同的消息发送给多个收件人。我使用PHP库XMPPHP,并使用以下代码发送单个消息:
<?php
include("xmpp.php");
$conn = new XMPP('talk.google.com', 5222, 'username', 'password', 'xmpphp', 'gmail.com', $printlog=False, $loglevel=LOGGING_INFO);
$conn->connect();
$conn->processUntil('session_start');
$conn->message('someguy@someserver.net', 'This is a test message!');
$conn->disconnect();
?>我试着使用下面的循环:
$conn->message('someguy@someserver.net', 'This is a test message!');或者包含完整代码的循环。但是什么都没发生。
诚挚的问候,
汉尼斯
发布于 2009-09-26 09:52:31
我会在循环中使用$conn->message('someguy@someserver.net', 'This is a test message!');行。
该行之前的代码建立连接并等待xmpp会话启动。
这一行后面的代码断开了连接。
发布于 2009-09-10 19:40:27
也许你需要在断开连接()后销毁$conn;如果它在循环中,在你再次使用它之前?
或者给每个$conn一个唯一的名字?
发布于 2009-09-30 12:21:17
确保someguy@someserver.net (您要发送的人)已将username@gmail.com (您要发送的帐户)添加为好友。
https://stackoverflow.com/questions/1386771
复制相似问题