By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
458,124 Members | 1,528 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 458,124 IT Pros & Developers. It's quick & easy.

Problems sending IM from perl MSN messenger

100+
P: 154
Problems sending IM from perl MSN messenger

Hi I am trying to send a msn message from perl msn messenger but I am trying to send am essage and nothing works.

This is the cod eI am using could someone tell me where i am going wrong please.

Expand|Select|Wrap|Line Numbers
  1. #!/usr/bin/perl
  2.  
  3. use Net::Msmgr;
  4. use Net::Msmgr::Session;
  5. use Net::Msmgr::User;
  6.  
  7. $ssid = "msncontact@hotmail.com";
  8. $message = "Test from perl client";
  9.  
  10. our $session = new Net::Msmgr::Session;
  11. our $user = new Net::Msmgr::User(
  12.     user => 'username@hotmail.com',
  13.     password => 'password',
  14. );
  15. $session->user($user);
  16. $session->login_handler( sub { shift->Logout } ) ;
  17. #$session->connect_handler () ;
  18. $session->Login;
  19.  
  20. print "Username is: ", $user->user ."\n";
  21.  
  22. #Initiate list syncronization.
  23. $session->ui_sync;
  24. print"$session->ui_sync \n";
  25.  
  26. #Ping the Notification Server.
  27. print "$session->ping \n";
  28.  
  29. #Online Status
  30. $session->ui_state_nln;
  31. print "$session->ui_state_nln";
  32.  
  33. $session->ui_new_conversation;
  34.  
  35. $session->ui_send_message($ssid, $message);
Apr 30 '07 #1
Share this Question
Share on Google+
4 Replies


KevinADC
Expert 2.5K+
P: 4,059
change this line:

Expand|Select|Wrap|Line Numbers
  1. $ssid = "msncontact@hotmail.com";
to:

Expand|Select|Wrap|Line Numbers
  1. $ssid = 'msncontact@hotmail.com';
and see if that helps.

The double quotes in your code is causing perl to treat @hotmail as if it were an array, an empty one in this case, so $ssid is being defined as "mscontact.com" instead of "msncontact@hotmail.com". The single-quotes in my suggestion will eliminate that problem.
Apr 30 '07 #2

100+
P: 154
Hi Kevin

I did that change but it did not work.

any other ideas?
Apr 30 '07 #3

KevinADC
Expert 2.5K+
P: 4,059
Sorry, I don't know anything about those particular modules, I would have to read the documentation to see if you are using them correctly, but you can do that as well as I can.
Apr 30 '07 #4

P: 3
Hey guys,

I'm trying to use the same package (net-msmgr) to send IM from Perl, but with no luck either. I know for one, or at least I'm pretty sure, that your ssid Jonathan should not be set to an email address. It should be some network identifier which I'm sad to say I don't know what it should be either.

I think you should be passing the email of the person you want to chat with to your Conversation object. Also, I'm pretty sure you need to associate a switchboard with your conversation as well and you send the switchboard the ssid.
Expand|Select|Wrap|Line Numbers
  1. my $switchBoard = new Net::Msmgr::Switchboard( ssid => '8888' );
  2. $conversation->switchboard( $switchBoard );
  3.  
I really wish there was more documentation on this package.

Please let me know if anyone has made any progress on this.

-Karim Varela
Jul 27 '07 #5

Post your reply

Sign in to post your reply or Sign up for a free account.