We help IT Professionals succeed at work.

Check out our new AWS podcast with Certified Expert, Phil Phillips! Listen to "How to Execute a Seamless AWS Migration" on EE or on your favorite podcast platform. Listen Now

x

Reading Lotus Notes mailbox from C#

stanforda
stanforda asked
on
Medium Priority
2,546 Views
Last Modified: 2013-12-18
We have a .NET windows application written in C#. We have a mail account set up in "Lotus Notes 6.5" for emails sent to our customer service department. I want to get the C# application to "read" the email that arrives in this mail box.

The reason is that we have some jobs that we wish to automate. For example, a customer might request us to resend a quote. In this instance the C# application will read the request and resend the quote, rather than having a customer service representative do it manually.
Thanks in advance.
Comment
Watch Question

√Čric MoreauSenior .Net Consultant
CERTIFIED EXPERT
Top Expert 2016

Commented:
can you use POP3 to access your mailbox? I use http://www.lesnikowski.com/mail/Index.aspx to retreive emails from Exchange.
Unlock this solution and get a sample of our free trial.
(No credit card required)
UNLOCK SOLUTION

Author

Commented:
Thanks for the very quick responses. I had a couple of issues getting the client running on my dev machine as I normally run Notes in Citrix, but got the client working OK in the end.
 Just a couple of things.;
- I initially couldn't get the Session to start... then I realised I hadn't set the password...doh. Sorted that, so no worries.
- sess.GetDatabase always returned NULL no matter what I put into the Server and FileName. I went into the Notes Client and looked at the database properties and used the sames settings in the call... still no joy. Had a bit more of a dig around and found these;
                NotesDbDirectory dir = sess.GetDbDirectory("");
                NotesDatabase db = dir.OpenMailDatabase();
...did work OK, so that is good.
- Should there be some "tidy up" code to close the session when the application ends?

Cheers,
Andrew
RE: "sess.GetDatabase always returned NULL no matter what I put into the Server and FileName"

Probably due to the Citrix environment.  I've never seen this fail before.

RE: "Should there be some "tidy up" code to close the session when the application ends?"

I'm not sure if it makes a difference in C#, but I usually set my Domino objects to null when I'm done with them.

Author

Commented:
I "normally" run Notes in Citrix, but to test this I ran locally... hence the need to configure the client on my local PC.

I'll just set my objects to null to finish. A lot of these type of objects (i.e. that consume network resources)  usually have at least a "dispose" method which would clean up any resources it was consuming. I guess the .Net Garbage Collector will tidy this up eventually if need be.

Very pleased to find a solution. Thanks for you help
Unlock the solution to this question.
Thanks for using Experts Exchange.

Please provide your email to receive a sample view!

*This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

OR

Please enter a first name

Please enter a last name

8+ characters (letters, numbers, and a symbol)

By clicking, you agree to the Terms of Use and Privacy Policy.