Tag Archive for 'protocol'

sendMsg updated again, stable release

Following up on my last post about the updated sendMsg script, I have another update available.

This update will now catch error 800 from the server. The server imposes a limit of creating 8 IM sessions in any 60 second period and will throw this error if you try calling createSession a 9th time. As such, the script is not suited for sending messages to more than 8 contacts in the same login session. All other changes are programming improvements.

This will be the final update for a while, if there are any major bugs reported I will fix them, otherwise consider this stable.

Download and check out Troubleshooting phpListGrab if you are having connecting problems (phpListGrab uses the same code base). I will also be posting more troubleshooting information for other problems I have recently discovered with server configuration compatibility.

New version of sendMsg available for testing

The script I created over two years ago to send a message using PHP has gained quite a lot of exposure over the last few months, and a common request I have been getting is the ability to send messages to more than one user.

Over the weekend I modified the class with the following changes:

  • Function to manually create an IM session with a user.
  • Function to send a message on the newest IM session.
  • Font face and colour support for the sendMessage() function.
  • Better error handling when connecting to the messenger server.
  • simpleSend() function to send a single message like the original version.
  • error property to get socket error.

sendMsg: Sending messages using PHP

sendMsg is a class which allows you to send a message to a contact from a specified account. It logs in, changes status to online, creates a new IM session with the target user, sends the message and ends both connections.

The Messenger server imposes a limit on how many IM sessions can be created per minute, so the script is not suited for sending messages to large numbers of contacts within the same login session (see below).

The user sending the message must be on the allow list of the receiving user; or, the target user must have “All others” on their allow list (as in the Windows Live Messenger options dialog). To get the login ticket for authentication it uses the MSNPAuth class, which is included in the ZIP file.

Because of the way the protocol works, the sending user doesn’t appear to come online because it does not synchronize lists.

This class has not been extensively tested, if you find a bug or error, please post a comment here.

Continue reading ’sendMsg: Sending messages using PHP’