LOTUSSCRIPT/COM/OLE CLASSES


Examples: GetMailInfo method
1. The following example searches the directory on the server "server name" for the home server information of "Joe Smith" then displays that information.

Sub Initialize
       
    Dim session As New NotesSession
    Dim db As NotesDatabase
   
    Dim mynotesdir As NotesDirectory
   
    Set mynotesdir  = session.getDirectory("server name")
   
    Dim homeserver As Variant
       
    homeserver =  mynotesdir.GetMailInfo("Joe Smith", True)
   
    Msgbox "Mail Server: " + Cstr(homeserver(0))
    Msgbox "Build Number: " + Cstr(homeserver(1))
    Msgbox "Domino Version: " + Cstr(homeserver(2))
    Msgbox "Mailfile: " + Cstr(homeserver(3))
    Msgbox "Short Name: " + Cstr(homeserver(4))
    Msgbox "MailDomain: " + Cstr(homeserver(5))
    Msgbox "Username: " + Cstr(homeserver(6))
    Msgbox "internetMailAddress: " + Cstr(homeserver(7))
    Msgbox "Out of Office: " + Cstr(homeserver(8))
   
End Sub
2. The following example uses the getver flag to get partial information about a user's mail file server if the first attempt to get mail information fails.

Function RetrieveMailInfo() As Integer
   On Error Goto ErrHandle
   RetrieveMailInfo = False

   Me.m_vOwnerMailInfo = Me.m_dirDirectory.GetMailInfo(Me.m_dbOwner, True)

   If Isempty(Me.m_vOwnerMailInfo) Then
      Me.m_vOwnerMailInfo = Me.m_dirDirectory.GetMailInfo(Me.m_dbOwner, False)
   End If
End Function