Accessing Outlook REST API from C# Console App on Windows XP - c#

I'm updating a very old VB.NET console application to C#. The old application used the Domino libraries to send and search through received email through a Lotus Notes client.
My organization has since migrated all email to Office 365 and the Lotus Notes server will be retired soon. I need to be able to send emails through the Outlook REST API, and use the API to search for any email received since the last time the app ran with a specific key word in the subject (no need to actually read the email, just the subject.)
I've set up the app in https://dev.outlook.com/AppRegistration, checked all the Mail API boxes and copied the Client ID. But now I'm unsure how to proceed, since every tutorial I see involves an interactive session where the user grants access to the application. My application needs to be able to run unattended. No live interaction will be possible.
To further complicate the issue, I'm developing this app using Microsoft Visual C# 2010 Express on a Windows XP virtual machine. I could probably get our IS department to upgrade the virtual machine, but most likely Windows 7/Visual Studio 2013 will be as up-to-date as I can get.
Can anyone point me to a tutorial for authenticating with the Outlook REST API in a C# .NET console application without requiring user interaction?

Related

Is there any Office Web Apps Server Api available?

I want to allow user to be able to edit office documents online within the web application.
I have come to know that I can do it easily by installing Web App Server
But it requires a separate isolated server for installing it. Or I need to install it on virtual machine.
I was wondering if is there any api available (which already have Web App Server installed on it), which I can use directly with my web application to fulfill my requirement?.
The web-based Office document editing is achieved by implementing MS-WOPI protocol. The protocol consists of three parties - a WOPI Server (app serving the files...typically your app or SharePoint), a WOPI Client (Office Web Apps) and a client browser.
Unless you want to implement your own WOPI client (which should be possible but I haven't seen anyone trying to go that path) you have to use Office Web Apps or its younger brother Office Online Server.

Run external code or application on connected client desktop from application that published via RemoteApp or Citrix ICA?

I have desktop app on server, that can be used by clients via Microsoft RDP or RemoteApp or Citrix ICA. And now i need to somehow interact with REAL user desktop from that application running on server in RDP/RemoteApp/ICA session.
Is there exists some server-side API in Microsoft RDP/RemoteApp or Citrix ICA that can be used to implement this?
My app is currently written in C#, but i can easily use COM/WinAPI if needed.
Yes, on Citrix you can use the Virtual Channel SDK:
https://www.citrix.com/downloads/citrix-receiver/sdks/virtual-channel-sdk.html
Microsoft also has something similar if you want to use RDP:
http://msdn.microsoft.com/en-us/library/aa383509%28v=vs.85%29.aspx

send data from a C# asp.net web site to an installed C# windows forms app

I'm working on a net based POS system and need to enable silent printing.
(Print without displaying the PrintDialog).
I have managed to get it working but at times when cashiers want to generate new vouchers it does not print and this is becoming a problem.
I have been instructed to create a Windows Forms app that will be installed on all of my cashiers machines, what this app needs to do is once the cashiers log onto the website and sells a voucher i need data to be sent from my ASP.NET website to the Windows form application where the silent print can take place, so as soon as the cashiers clicks on the 'Sell Voucher' button the data must be sent to the installed windows app and print automatically.
The data that will be sent to the cashiers machines is basic info like Cashier Name, Account Name, Site...etc
How would i go about achieving this result?
Thank you in advance.
The two apps will probably need to share a single data source (e.g. using SQL Server).
If the printing needs to happen silently, without user intervention, then you will need to implement a listener (typically as a Windows Service) that waits for new items to be added and are ready to print.
See: Publish-subscribe pattern or, alternatively, Observer Pattern.
Look into WCF or signalr.net
for signalR there is a .net client for easy implementation into a windows app

How do I access Outlook mails with ASP.NET?

I'm trying to write an asp.net (using c#) app that accesses my Outlook mailbox and display the messages. I searched on google but couldn't find useful info, any help is appreciated?
You must be aware of the fact that outlook is running on user local machine, and your ASP.NET application is running on some server and there is no way that your server side ASP.NET code can use Outlook local data.
AFAIK only way to do something like that would be creating outlook addin that will export all mails to ASP.NET application
If you are using Exchange then you can use Exchange Web Services to read emails.
Please see here
Be very careful that you do not attempt to access Outlook on the server side by using the Automation interfaces. All of the Microsoft Office desktop applications are written to be run by an interactive user in a process with a message pump, with all synchronization happening via the UI. When you run them in a multi-threaded environment like ASP.NET, horrible things will happen. If you're lucky, the application will simply crash.
If you're not lucky, you can suffer from data corruption, random crashes in unrelated code, and all the other things that happen when an application corrupts memory.
You may also violate your license if the people accessing the Office application through your web site are not individually licensed to use the application on their desktop.
You can't connect to Outlook via C# (ASP.NET), but you can connect to your mailserver via POP3/IMAP to read the mail.
IMAP Client library using C#

C# / Exchange EMail Client

I need to create a very simple c# Windows Service to listen for, and process email wth special subject lines. I already have the code that process these emails working well. For ease of development, I just packaged the code in an "Outlook Addin" on my own machine, running under my own email account. Works great.
Now that it's working, I need to move this to the server. I have a special email account setup on the Exchange Server for this purpose. I really don't want Outlook running on the server. Is there some other way to login to this email account and listen for email from my Windows Service without using the Outlook client?
Thanks!
It sounds like your code is closely tied to Outlook, so you may have to change your approach for the server. I faced exactly the same problem last year and considered the following options :
CDO (not supported by Microsoft with .NET due to some strangeness when running in process)
WebDAV for Exchange 2003
Web Services for Exchange 2007 (great example in the link)
You also need to ask yourself - do you actually need your program to check the mail server? I couldnt use any of the above options so ended up having one of the mail admins set up an exchange rule that dropped the emails/attachments into a special folder on the server. I could then process the files at my leisure. Worked extremely well and much easier to maintain than directly interrogating the mail server through code.
If your exchange admin has enabled it you can use IMAP or POP3 to connect to the server.
You can also use MAPI to connect as well.
You can find a number of libraries (free and otherwise) for doing all three.
I have had good experience with MailBee IMAP but there are definitely free alternatives if you only need to do some simple functionality.

Categories