Subject: How to send a message from an external component
Hi everybody. I'm quite new at this technology, and I' m trying to do a PoC for my job. I tried to start making an external component, that connects to the server and then send a message to a Pidging account.
The Server chosen is OpenFire or Ejabberd. With both servers I connect, but i don't get through to send a message to the Pidging account.
This is my code:
public static void Main(string[] args)
{
XmppComponent comp = new XmppComponent();
comp.Hostname = "home";
comp.XmppDomain = "home";
comp.Password = "admin";
comp.Port = System.Int16.Parse("5275");
try{
comp.Open();}
catch (Exception e) {Console.WriteLine(e);}
System.Console.WriteLine("Press a key to send a message");
System.Console.ReadKey();
try
{
comp.Send(new Message
{
To = "matias@home/pidging",
Type = Matrix.Xmpp.MessageType.chat,
Body = "Theres been a setting change"
});
}
catch (Exception e) { System.Console.WriteLine("{0}", e);}
System.Console.WriteLine("Message send it succesfully");
System.Console.ReadKey();
}
Ok, like I explain before, I connect to the Server but I can't send a message to the user. I don't know what I'm doing wrong. I hope you can help me in anyway.
I put a try catch, for see the error, but it seems like there's no error trying to send the message.
Thanks a lot. Matias
The Server chosen is OpenFire or Ejabberd. With both servers I connect, but i don't get through to send a message to the Pidging account.
This is my code:
public static void Main(string[] args)
{
XmppComponent comp = new XmppComponent();
comp.Hostname = "home";
comp.XmppDomain = "home";
comp.Password = "admin";
comp.Port = System.Int16.Parse("5275");
try{
comp.Open();}
catch (Exception e) {Console.WriteLine(e);}
System.Console.WriteLine("Press a key to send a message");
System.Console.ReadKey();
try
{
comp.Send(new Message
{
To = "matias@home/pidging",
Type = Matrix.Xmpp.MessageType.chat,
Body = "Theres been a setting change"
});
}
catch (Exception e) { System.Console.WriteLine("{0}", e);}
System.Console.WriteLine("Message send it succesfully");
System.Console.ReadKey();
}
Ok, like I explain before, I connect to the Server but I can't send a message to the user. I don't know what I'm doing wrong. I hope you can help me in anyway.
I put a try catch, for see the error, but it seems like there's no error trying to send the message.
Thanks a lot. Matias