Send messages to Client with C# using openfire server - c#

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.

Related

How can I send an XMPP message using 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?

Use SMTP Server in Windows 2012 from C#

I need a SMTP server for Windows Server 2012 so that I will be able to intercept incoming emails from my C# application and display it to my clients via an ASP.NET application. Sorry if this would look like a trivial question but i cant figure out where should i start from.
The most obvious Windows SMTP server is Exchange, although there are plenty of free ones (XMailServer, MailEnable or the lighter-weight Papercut, which might serve your purpose) - I've not used anything other than Exchange, but a Google search will find you a tonne of them.
Is this just for sending messages from client to server, though? Unless there's some reason you need to have these messages as emails, it seems unlikely the overhead of setting up an entire email system, sending an email and then extracting the message and putting it into a web page is the best solution to your problem - have you considered a lighter-weight client-server messaging system, such as DotNetMQ or simply sending your own messages directly through TCP sockets?

Why do I get 'service unavailable' with multiple chat sends when using XMPP?

I have made a simple IM client in both Python and C#, using a few different XMPP libraries for each.
They work very well as simple autoresponders, or trivial bots, but when I turn them into chat rooms (ie, a message gets reflected to many other JIDs), I suddenly start getting 503 service-unavailable responses from the Google talk server.
Where should I start looking to resolve this issue? Given that I have used several languages and libraries, I don't think this is a problem with my particular setup. I am using the various examples provided with the libraries.
Do you have all people you try to send messages to in your rooster?
Otherwise GTalk won't allow the message to be sent and instead return Error 503.
There was a pidgin bug tracker describing a similar problem:
Pidgin #4236
If you're sure you have all the JIDs in your rooster you should also check how manny messages are send in parallel. Google will limit the count of messages a single
JID is allowed to send in a specified period of time.
If you're looking to create actual chat rooms, why not rather get a jabber server to host those (following http://xmpp.org/extensions/xep-0045.html - ejabberd has these as default and there are plugins for most jabber servers to implement them), and then have your bot join that room (most clients support this - Google Talk doesn't unfortunately)?

Creating an IMAP client application in Silverlight

I'd like to make a stripped down email client for my pre-schooler using Silverlight 3 and pulling email from a Gmail account.
I'll have some filters setup in Gmail so that only a subset of email is given a particular label, similar to creating a whitelist. Then, I'd like to pull those emails with that label to the Silverlight client. I'd like to avoid running any of the messages through the server (so that I can share this application with friends and not have their email app require a server).
I've never written any sort of email client (POP3 or IMAP) and am not sure if this will even be possible. Looking through the various libraries available for retrieving via IMAP, I can't find references to using a browser-limited client such as Silverlight.
Also, I'm guessing I'll be able to send via .NET built in SMTP objects in Silverlight, but haven't tested this yet either.
Can anyone point me in the right direction; tell me why this may or may not be feasible; or relate their own experiences regarding this type of challenge?
Silverlight does not yet allow arbitrary socket connections, which you would need to connect to an IMAP server on the privileged port of 143. Silverlight can only connect to servers, even with a client access policy file, on ports 4502-4534.
Your only options are to proxy to gmail via a server on those ports, or just do the IMAP work on the server and serve it down to the client app over HTTP.
Sorry about this-- enhanced socket support is always being looked at, but it has scary security implications and hasn't been implemented yet. Good luck finding a solution to your scenario.
There is a great example of a Silverlight based mail client here:
http://silvermail.com.au
I use this regularly to check my personal email from work, and I know that it works with GMail.
Hope that helps.

How to create an IM bot with C#

Is there an easy way to create an IM bot on multiple im networks (aim, gtalk, yim, etc) that can accept and interpet specific commands sent to it to perform a server related task?
Lets say for instance I have a website for managing an rss feed. I want to send a command to an IM bot to add another feed to my collection. the IM bot would associate my screen name with my account from prior setup on the website.
I have done some internal bots for my company using the XMPP (Jabber) protocol, I've used the agsXMPP SDK and the Jabber.NET client libraries, I was looking for APIS to work with YIM, AIM and Windows Live Messenger but I've found only COM exposed APIS, nothing for .NET...
But an idea comes to my mind, with the XMPP Protocol you can configure a local server with IM Gateways, that allow users to access networks using other protocols through your server
I use eJabberd, you can install a variety of transport gateways to connect with other IM protocols (AIM, MSN, ICQ, GTalk...
To GTalk you can connect directly using the libraries I mention...
A sample ICQ gateway:
The short answer to this question is yes this can be done relitivly easily. Sedning and receiving IMs sending, receiving and interpreting requests from the network you wish to communicate on and there are libraries available for each of the major IM protocols to make this easier.
For messenger you can try the DotMsn library, I have used it in the past but at that time it was still quite new and I have not used it since so I can't vouch for it's quality.
Jabber uses the XMMP protocol which is an open-standard so there are bound to be plenty of client libraries available.
If I recall correctly Google Talk uses this protocol or a modified version thereof.
I dont have experience with c# but I have written one for AIM and Gtalk using PHP. http://www.imified.com/ is the best place to start if you looking for a easier way to write an IM bot.
Basically you create an account in imified.com .
Name your bot and link a script.
When ever a message is sent to the bot, imified.com automatically runs this script.
Here is a link for you get you started!
We have professional .NET/COM/VCL library for MSN/Yahoo/ICQ/AIM/GTalk/Jabber. Please take a look at http://www.imcomponents.com/ if you like.

Categories