Posted: Fri Nov 18, 2005 4:59 pm Post subject: Sending a MSN msg with PHP.
Hi dee Ho.
I am not sure if this is right place to ask.. But looks like you have lots of knowledge here, so I'll ask anyways ^_^
This is my first post to here, so before I start asking noobish questions, I will shortly introduce meself.
I am a student, studying physics. I also work in cupp-project, developing some equipments/software for our experiments, as well as taking care of our network. More about cupp here : http://cupp.oulu.fi
Now, the 1st. question.
I have been developing a php script, which should send one message to certain msn account, if some conditions are true. The developement has not really yet begun, I am just testing if I can send a message. Well, login to msn main server works fine, and I can also login to switchboard server, but when I try to invite someone to switchboard server, in order to send him/her a message, I will not get any reply from the server. So I'll paste the code in here, and if someone spots the error, please inform me
Logical structure of the code is not logical at all.. I'm sorry. But as I said, this is only something to test if the basic idea works. Anyways the CAL <trid> <user> command does not return anything, and I am puzzled...
Please ignore all junk there is, and also please forgive the bad coding standards.. I just try to get the idea working, and after that I'll do the real script...
Code:
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
<head>
<title></title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
</head>
<body>
<?php
class socket {
var $_socket;
// var $socket;
var $_socket2;
var $response;
var $server;
var $bla;
var $ble;
var $received;
var $portti;
var $loginacc="Secret@someserver.xx";
var $pass="Top_Secret";
function PassportChallenge($challenge)
{
//Login to passport and get the response
$passport_host='login.passport.com';
$passport_url='login2.srf';
$dastatus='failed';
do {
$fp=fsockopen("$passport_host",'80');
if (!$fp){
echo "Error connecting to $location<br>\r\n";
} else {
fwrite($fp,"GET /$passport_url HTTP/1.0\nAuthorization: Passport1.4 OrgVerb=GET,OrgURL=http%3A%2F%2Fmessenger%2Emsn%2Ecom,sign-in=".$this->loginacc.", pwd=".$this->pass.",$challenge\r\n");
$html='';
while (!feof($fp)) {
$html .=fgets($fp,2048);
}
Well, I've also been wanting to do what you are doing. I found some codes at http://www.phpclasses.com. I was unable to get them to work, but they almost did. Lol. Maybe you can find some there, and maybe study it a bit.
I don't know the protocol well enough to help you, however I can suggest looking at Blobsy's source for an example . _________________ ~ Josh
[ Need bot hosting on a dedicated server? PM me. ]
In the post before, you said it signs in and out each time it has to send a messge. Now you say it doesn't sign in or out. Can you make up your mind please?
What do you mean it allows people to use their own accounts? Who is getting knocked off MSN? I'm talking about a bot running on the server accepting new messages via the web and sending them off to users, just like you're doing. I just don't see what's so special about this. Any MSN bot can do it.