0

I have to create sort of a .PST file based Web Mail.

I need to read all MailItems, Folders, Contacts and everything i can from PST files given by the user.

I am currently using DCOM interop to create a Application and use Session to add my file's stores.

My problem is that i can't even instantiate the Outlook.Application, the code simply doesn't run.

If i change to Visual Studio Development Web Server everything works as perfectly as expected, but if i change to local IIS Web Server.. nothing happens =/

What i did so far:

  • Set username and pass to impersonate on web.config
  • Set username and pass to inpersonate on my WebSite from iis -> Authentication -> ASP.NET impersonation
  • Added permissions to Everyone, Network Service, IIS_IUSRS, my user account in temp asp files, web site file and pst files i'm trying to read

Unfortunately I've already implemented all I need using TDD, so it would not be a good idea to change the way i'm doing this, like moving to NMapi or something.

Thanks in advance

EDIT:

As i've mentioned before, i I cannot use another library (and that one seems to work, but it's pretty expensive).

I only need this to run on a local server. It is a Web application, but for localhost ONLY.

1 Answers1

0

It is not a good idea to use Outlook on the server side, as is described in detail here: http://support.microsoft.com/kb/257757

Microsoft does not currently recommend, and does not support, Automation of Microsoft Office applications from any unattended, non-interactive client application or component (including ASP, ASP.NET, DCOM, and NT Services), because Office may exhibit unstable behavior and/or deadlock when Office is run in this environment.

Maybe have a look at http://www.independentsoft.de/pst/

David Tischler
  • 2,642
  • 22
  • 13
  • Even if the website is running in IIS on the local machine, automating office applications from ASP.NET is neither recommended, nor supported. One example: The application could popup a dialog at any time, waiting for user input, but as it is started from a service, nobody sees the dialog and it will wait indefinitely. Before Vista you maybe could have granted the IIS service permission to interact with the desktop and set its account to the one of the user, which might have helped in your specific case (but this is pure guesswork), but since Vista this is not possible anymore. – David Tischler May 10 '12 at 07:20
  • Alternative PST libraries would be https://pstsdk.codeplex.com/, but this is C++, and its .NET-clone https://pstsdknet.codeplex.com/, but this doesn't look finished. – David Tischler May 10 '12 at 07:25
  • A quick thought for your specific scenario (running locally, accessed by the logged on user): you could try deploying your website with IIS Express https://www.microsoft.com/en-us/download/details.aspx?id=1038, which runs as a user process and not as a service. – David Tischler May 10 '12 at 09:11