Question

Whats the easiest way of getting the abbreviate name of a users mail mail server, the current user to be specific

Was it helpful?

Solution

Function getUserMailServer() As NotesName
    Dim session As New NotesSession
    Dim maildb As New NotesDatabase("", "")
    Call maildb.OpenMail
    Dim nName As NotesName
    Set nName = session.CreateName(maildb.Server)
    Print("Server: " + nName.Abbreviated)
    Set getUserMailServer = nName
End Function

maildb.OpenMail gives you the mail database of current user.

maildb.Server returns the full server name of mail database.

session.CreateName() creates a NotesName object from server name.

nName.Abbreviated returns the abbreviated server name (same like maildb.Server).

OTHER TIPS

You could also use the GetMailInfo method of the NotesDirectory class. This enables you to get the mail-database of every user you specify.

mailinfo = notesDirectory.GetMailInfo(username)

mailinfo is a Variant containing a String array with the following informations for the specified user:

Mail Server - Home mail server for the specified person.
BuildNumber - If getver is true, a string representation of the build number of the specified person's mail server, for example, "303". If getver is false, "".
DominoVersion - If getver is true, a string representation of the Domino version of the specified person's mail server, for example, "Build V80_07042006NP". If getver is false, "".
MailFile - Mail file for the specified person.
ShortName - Short form of the specified person's name.
MailDomain - Notes Domain of the specified person's mail address.
User Name - First entry in the list of user names honored for the specified person.
InternetMailAddress - Internet mail address for the specified person.
OutOfOffice - Out of Office service type. "1" indicates Agent, "2" indicates Service.

See IBM help here for more information.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top