用Lotus脚本获取用户的邮件服务器

时间:2013-11-01 09:44:18

标签: lotus-notes lotusscript

获取用户邮件服务器的缩写名称的最简单方法是什么,当前用户是特定的

2 个答案:

答案 0 :(得分:3)

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为您提供当前用户的邮件数据库。

maildb.Server返回邮件数据库的完整服务器名称。

session.CreateName()从服务器名称创建一个NotesName对象。

nName.Abbreviated返回缩写的服务器名称(与maildb.Server相同)。

答案 1 :(得分:2)

您还可以使用NotesDirectory类的GetMailInfo方法。这使您可以获取指定的每个用户的邮件数据库。

mailinfo = notesDirectory.GetMailInfo(username)

mailinfo是一个Variant,包含一个String数组,其中包含指定用户的以下信息:

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.

有关详细信息,请参阅IBM帮助here