Retrieving Email Address using Java Corba?

I am using Java Corba API to access the domino’s contents.

I am having a user’s nsf file, I want to know how to retrieve the email address for the corresponding user.

The problem is i want to create one event and i want to set the email address instead of username in the created by so that i can send mail back to that user from my application, any kind of help will be helpful.

I am not getting any method in the database or session class to retrieve the email address for the corresponding user.

thanx in advance.

Amit Saini

Subject: Retrieving Email Address using Java Corba ???

I don’t quite understand what you mean by “I am having a user’s nsf file”. Do you mean the user’s mail database?

You can retriwve the mail database owner (Notes Name field - canonical CN=…) from the CalendarProfile, Owner field.

LotusScript Equivalent:

Set prefDoc = db.GetProfileDocument(“CalendarProfile”)

Messagebox prefDoc.owner(0)

Or, if you have the user name, and need the internet email address (SMTP), then perform a lookup into the “($Users)” view of the Domino Directory (names.nsf) of the server, using the user name, and you can read back the email address from the Person document (or from the appropriate view entry column value).

Subject: RE: Retrieving Email Address using Java Corba ???

thanx morten,

sorry for not clearly mentioning my problem. I am having a mail database (user1.nsf) and i am retrieving the data (Calendar items) from that file but i want the email address for the corresponding user (whose nsf file i am having),

like for the corresponding user i want user1@domain1.com but i m having fields to get the user name only.

I need this field for sending mail back to this email address…

are you clear with that.

thanx

Amit

Subject: RE: Retrieving Email Address using Java Corba ???

OK, if you need to find the internet mail address of a user, you do that by looking up the user’s person document in the Domino Directory (names.nsf) as outlined in my first response.

But can’t you use Domino to send a mail document to the user directly (using the user name - hierachical or canonical), without having to resort to SMTP/Internet mail?

You simply create a new document using notesDatabase.create(), set the Form field to “Memo”, Subject and Body fields according to your content requirements using notesDocument.replaceItemValue(name, value), and use notesDocument.send() method to let Domino route the mail to the user (using the user name) directly. No need to extract the internet mail address.

Subject: RE: Retrieving Email Address using Java Corba ???

thanx morten,

Problem is that, In my application i am using hte SMTP protocol to send mails to the user (no doubt i can user your way also) but sometimes i might get the meeting request from the Exchange server also so not good to follow two ways of sending mail (one for exchange and one for domino). I hope you are getting.

Marten, As a new to Domino, could you please explain me how to lookup in the names.nsf? or i have to iterate in each and every document of view $users inside the database (names.nsf). thanx for your help.

thanx a lot

Regards

Amit

Subject: RE: Retrieving Email Address using Java Corba ???

If you don’t know how to lookup documents in a view, you need to read a book…

use notesView.getDocumentByKey(key, true)

where key is any name that uniquely identifies the user (common name, hierachical user name, canonical user name, internet email, shortname, …). Alternatively, use notesView.getAllDocumentsByKey(key, true) to be able to detect multiple matches.