How can I send an XMPP message using C#? - c#

I am building an application, using C#, to use for distributing alert information at my work place. At this time we have to manually send each alert to multiple emails, a forum, a notification website, and a XMPP chat server (We use Pidgin to connect to it currently). I have been able to successfully link my application to all but the XMPP server.
I only need the code to connect to the server using one username and send a single message to a distribution user (that broadcasts what ever it receives to all other users) and then close the connection.
Does anyone have any ideas on how I should go about doing this?

Related

Event server for .net

I've a winform app that is connected to a sql server database and there are many pc client with the application installed. A standard desktop client/server application.
I want that a single client can communicate with all others, for example I want the administrator cand send a message to all clients. Something like SignalR fir asp.net.
I do not want that is the client that ask to database if there are messages, I want that all clients connects to a service that raise events like broadcast message or chat.
I prefer not to install something that needs a web server, but I will consider all your suggestions. Also I'd like to know if there is a specific name to this functionality so I can do a more accurate search.
thanks to all

How to send a Notification to a specific user, using ChannelUri on a .net backend

I have earlier used windows phone 8.0 with javascript backend, which enabled me to send pushnotifications to specific user based on the stored ChannelUri in my tables.
I have since then moved on to .net since I can then use class' on my client and on the server for verification. However I am not able to find a way of sending to specific users. I am not using NotificationHub, and I am only planning on doing this at later point for broadcasting but for normal communication to other users I would like to send Notifications directed at a user.
I have found this link, that users tags to send to specific users(my users are authenticated). I however would like to know if this is the only solution or if you could also use channelUri and if so how you do it?
Basicly how to send a pudhnotification from server side directed at a specific user?
I had a scenario earlier. My server needs to push content to the connected clients in real time. For this I had used SignalR.
If my understanding is correct, this should suit your situation too.

Send messages to Client with C# using openfire server

Our firm is using message API's to send various alerts to our clients. As the charges are getting high for message API's we are planning to have WhatsApp sort of thing(An Android chat client) on our customer's phone and send messages to them through OpenFire server.
I am new to this. I searched over Internet and found jabber.net but the documentation didn't help me much to get started.
I found this on CodeProject but this is made to connect to GMail (though it is not even connecting to GMail). I tried changing the server to my PC's static IP but it didnt connect to it.
Please note that I am able to connect to OpenFire through Clients like jabiru(Android), Jabber(Android) and Spark(Windows Client) and chat with them. So no problem in server setting.
How should I start about with it.. How can I send messages to various clients on the basis of their username. Sorry for asking a foolish question but I am really stuck.
here you can find a list of XMPP libraries for c# .NET:
http://xmpp.org/xmpp-software/libraries/
All libraries listed there come with documentation and example, also jabber-net. The examples show you how to login and send messages. They should work out of the box with your Openfire server.

push messages from myapplication through XMPP

I am about to develop an application, in which the windows application will receive messages from the server when there is a new entry in server database. I am planning to do the same using xmpp and c# in asp.net. Is that a better way?
The scenerio is like this: Whenever a new entry is inserted into my sqlserver database, my windows application should be notified with that new entry. i.e. I want to push the message from the server to the windows application. How can I push the message using xmpp? Can I set the server as my company server? Or should I have to use jabber server itself?
Assuming there are multiple instances of the client running, then using some form of pubsub, like XMPP pubsub would be an appropriate solution. There are many pubsub solutions available, you will have to select the appropriate one based on all your requirements and/or restrictions.
If this functionality is considered business critical, then you should definitely be using your own server.
I don't know if any of the public XMPP servers have pubsub enabled and configurable by the public or not.

How to auto process emails when they arrive?

i have the current scenario:
my app generates for each user an
valid system email address of form
lets say: uuid#website.com
when an user has a problem/question he can send an
email from any address to that
predefined system email address
the app should receive the emails sent by the user and process them(check for spam, insert in db)
in this scenario a possible first solution that i had in mind was to pool the emails addresses on a 15 minutes period, process them(spam or not spam) in an external desktop app(or similar) and insert them in a database.
because i want to do this in .net, C#, SQL server 2008, and it should run on a webserver is the below solution possible using WCF?
i create a WCF webservice that when an email is received by an email address it captures it and starts the processing procedure.
One problem i see with WCF from the start is that i don't think that it can auto react, the only way i used wcf until now was only for calling it directly and receiving a result. So i think another layer should be put between the email server and the wcf service and that layer should "react" when something is received.
the main idea is to process the emails as they arrive not to be pulled out of the inbox periodically.
any pointers? thank you
You are right. A web service cannot capture anything for you. You will have to call(using an .ashx/or etc) the web service. That is what the web services are for, to be called.
the app should receive the emails sent by the user and process them
It sounds like you are looking to develop an email client; if so, then how about:
Create an email client app (for instance here)
Create a windows service, to help process the mails.
Assuming that you've tailored the client program, the windows service would work-with the client, look for new messages, and processes them accordingly.
For email client examples, checkout:
This answer
And this article
If connecting to Exchange 2007 SP1 or later Exchange Web Services looks like the best approach:
Read MS Exchange email in C#

Categories