1

As the title says, i want to send the same message to multiple recipients. I use the PHP library XMPPHP and send single messages with this:

<?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();
?>

I try it with a loop of this:

$conn->message('someguy@someserver.net', 'This is a test message!');

Or a loop with the complete code. But nothing happens...

Best regards,

Hannes

4

4 回答 4

1

我会$conn->message('someguy@someserver.net', 'This is a test message!');在循环中使用该行。

此行之前的代码建立连接并等待 xmpp 会话开始。

此行之后的代码使断开连接。

于 2009-09-26T09:52:30.980 回答
0

也许你需要在 disconnect(); 之后销毁 $conn; 如果它在一个循环中,在你再次使用它之前?

或者给每个 $conn 一个唯一的名字?

于 2009-09-10T19:40:26.760 回答
0

服务器对每个时间范围内可以发送的消息数量有限制。如果你循环发送一堆消息,我想你会很快达到这个限制。试试http://php.net/sleep

于 2011-04-18T20:38:14.883 回答
0

确保 someguy@someserver.net(您要发送给的人)已将 username@gmail.com(您发送的帐户)添加为朋友。

于 2009-09-30T12:21:16.520 回答