integrating Outlook with c# - c#

is it possible to integrate outlook with my c# program without having Microsoft office installed?

It depends on what functionality you are trying to achieve?
It also depends on your environment.Do you have access to exchange server?
For example, If you want to create appointments in outlook client for individual user, you can very well make use of webservice provided by Exchange server. However, it works starting with outlook 2007.

In a word, no. If you want to call an Outlook dll you will need Outlook installed.
Perhaps if you describe what you need to do there may be an alternative approach, such as calling Exchange Server as suggested by Edwin.

Related

Getting data from e-mail to c#

I wonder it is possible to get data from email message to c#?
It is?
If you have got an account configured in Outlook you may consider automating it. See How to automate Outlook from another program for more information. And C# app automates Outlook (CSAutomateOutlook) for sample code.
Also you may consider developing a managed add-in for Outlook. In that case you will be able to handle Outlook events and track what users do. See Walkthrough: Creating Your First Application-Level Add-in for Outlook for more information.

How do I programatically create an exchange 2010 mailbox using C# without powershell

I'm trying to create a Mailbox within C#, and I cannot use powershell (as per the requirements).
I have been able to successfully create a Distribution List without the need for powershell functionality.
Looking on various forums, the only possible solutions are not what I have the capabilities of doing.
I wish it were simple enough to utilize this functionality, however, I am in a bit of a jam.
I've managed to add several properties for Exchange 2010 in a mailbox so far, but there are only so many properties I am able to determine.
(msExchUserAccessControl for example).
I'm not sure what information I can provide that would be helpful beyond this.
Any assistance would be greatly appreciated
If you mean that you wish to create the mailbox from a client PC, not the Exchange server, and you may not install the management tools on the client, then you may be able to remotly execute the powershell scriptels. Look here:
Creating an Exchange 2010 Mailbox from a remote C# program

Outlook Interop from c# service

I have a barebones c# service installed and want to use the outlook.interop functionallity from within my program. Just to detect and read new emails recieved. I have the program that does this but it is a form application. Is it possible to use outlook.interop from a C# service?
Better avoid using an interactive application within a service environment. Using Outlook from a service is not supported by Microsoft and will get you probably in all sorts of trouble (think message boxes popping up for instance).
If you want to talk to an Exchange server better use CDO/MAPI or the Exchange Web service API.
If you want to talk to a POP3 or IMAP server use a dedicated library.
You should look at the Redemption RDO Library (commercial third-party tool), which is effectively a managed wrapper for MAPI that allows out-of-process access to Outlook stores. To detect new mail, you could subscribe to the RDOStore.OnNewMail event.

C# MAPI to read exchange server inbox

I want to write C# application which will remotely connect to exchange server and read my inbox! I want to use MAPI for that.
So I got two questions:
Can it be done remotely, and is there any requirements(e.g. install outlook client,etc? )
I was not able to find any code example in C# which uses MAPI to connect to inbox?
1) If I remember correctly Outlook must be installed and a profile must be set up. (In short; you are reading Outlooks data, not Exchange).
2) There are samples for this:
http://bytes.com/topic/net/insights/795371-accessing-inbox-through-mapi-using-c-net
http://g8.cx/mapi/ (See 4.7)
Note that MAPI/CDO is not supported in .Net.
Other options is to communicate directly using WebDAV, IMAP, POP3 or WebServices. All will work to retrieve emails. I recommend you try the webservice.
You can access the mailbox of a user from a remote machine.The email account should be configured on that machine and then you can read the mailbox using Microsoft.Office.Interop.Outlook and this link will provide you more info.
http://msdn.microsoft.com/en-us/library/ff870566.aspx
Why do you want to use MAPI so badly ?
Just use EWS:
http://www.codeproject.com/Articles/399015/Exchange-Web-Services

Open Microsoft Outlook from winforms C# (.net 3.5) application in reply mode

I open outlook from my Winfoms application. I want to open outlook in reply mode. How can I do this.
Thanks.
so you want to open outlook and have it ready to send an email to a prefered receiver.
the quick and dirty fix i think is to have a hidden webbrower in your program and let the browser navigate to mailto:mail#mail.com?subject=somekindsubject
which will open the default email client on the machine.
System.Diagnostics.Process.Start("mailto:youremailaddress#whatever.com");
The mailto can be used with a lot of parameters
Check out the parameters here
http://msdn.microsoft.com/en-us/library/aa767737(VS.85).aspx
http://www.ietf.org/rfc/rfc2368.txt
Eg (Taken from MSDN)
mailto:user#example.com?subject=MessageTitle&body=MessageContent
UPDATE:
Attachments i think are not supported due to security reasons and I strongly agree with it as well.
However Outlook 2003 seems to be accepting the parameter "attachments" according to someone who has posted in MSDN.
string email = "mailto:name#domain.com?attachments=\"\"C:\\file.txt\"\"";
System.Diagnostics.Process.Start(email);
This is the best i could do and i cannot test it as I do not have Outlook 2003. But even if it works in Outlook 2003, i strongly urge you not to use the attachment parameter as it may not be supported by different programs.
You can use something like:
System.Diagnostics.Process.Start("mailto:mail#address.com?subject=Sample subject");
Which will open the default email application filling in the to and subject fields. You can find more options here.
Edit: this takes a bit of time on my system, so make sure that if your user has a slower computer they'll know what's going on. Also, you should handle the case when they don't have Outlook or another mail program installed if it's a possibility.

Categories

Resources