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?
 
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
 
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
Cloud Class® Course: CompTIA Healthcare IT Tech

This course will help prep you to earn the CompTIA Healthcare IT Technician certification showing that you have the knowledge and skills needed to succeed in installing, managing, and troubleshooting IT systems in medical and clinical settings.

 
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
 
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
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.