Accessing Lotus Notes email from .NET code

I have a .net code inside a windows app that extracts attachments from my lotus notes email account.
everything works fine here.

Now I want the the same logic to work inside a windows service .net code. however I am getting this weird error that says "Notes error unable to find ID file " and this occurs when it tries to initialize the session object like the following.

session.Initialize("password").

I have checked that my nots.ini file and the id file are located inside c:\documnets and settings\ xyz\local settings\application data\Lotus\notes\data directory structure which I think is created by the lotus notes program itself.

and the KeyFileName=xyz.id

This is taking my time and I cannot believe it is working in windows application but not in a windows service code.

FYI the password is correct

Please help





 
codeloveratlAsked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Sjef BosmanGroupware ConsultantCommented:
> This is taking my time and I cannot believe it is working in
> windows application but not in a windows service code.
Better believe it...

The reason why: the service code is executed on the server. Most likely, there is no Notes client installed on the server, and if there were one installed, you wouldn't have your Id-file in the directory.

The best way is to write a webservice in Domino. Just a document: http://www.ibm.com/developerworks/lotus/library/nd7-webservices/
0
codeloveratlAuthor Commented:
sjef_bosman:

I know the document that you sent and as the document says domino objects is one of the options and I am using that.

 Domino objects enables you to connect to the database and I have successfully done that on my local machine using a .net windows application.

What I am trying to do is write a test windows service  that runs on my local machine (not the server) and on my local machine I have lotus notes client installed that is why I am able to write a .net code to get connected to my lotus notes database and access my emails.

Why does the same code work for a windows service that runs locally on my machine?



0
codeloveratlAuthor Commented:
sjef_bosman:

I know the document that you sent and as the document says domino objects is one of the options and I am using that.

 Domino objects enables you to connect to the database and I have successfully done that on my local machine using a .net windows application.

What I am trying to do is write a test windows service  that runs on my local machine (not the server) and on my local machine I have lotus notes client installed that is why I am able to write a .net code to get connected to my lotus notes database and access my emails.

Why does the same code does not work for a windows service that runs locally on my machine?
0
Bootstrap 4: Exploring New Features

Learn how to use and navigate the new features included in Bootstrap 4, the most popular HTML, CSS, and JavaScript framework for developing responsive, mobile-first websites.

Sjef BosmanGroupware ConsultantCommented:
Ah, a service, running locally... You might make this work when you set the default directory for the service to the Notes data directory.
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
codeloveratlAuthor Commented:
how do I set the default directory of the windows service to the notes data directory and what is the default directory of a windows service in the first place.

Thanks,
0
codeloveratlAuthor Commented:
codeloveratl:
I have figured out what default directory of the windows service means and also I have set it to the directory where the notes.ini file is located and it is now working like a charm and I can say you are the man !!!
0
Sjef BosmanGroupware ConsultantCommented:
Excellent!
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Lotus IBM

From novice to tech pro — start learning today.