getMailInfo (NotesDirectory - JavaScript)

Returns mail data for a specified person. .

Defined in

NotesDirectory

Syntax

getMailInfo(username:string) : java.util.Vector

getMailInfo(username:string, getver:boolean, errorOnMultipleMatches :boolean) : java.util.Vector

Parameter Description
username The name of the user for whom mail information is requested.
getver If true, requests build number and version information of the user's home mail server. Defaults to false.
errorOnMultipleMatches Indicate how to handle multiple matches for the user name. If true, throws an exception. If s false, uses the first match. Defaults to true.
Return value Description
java.util.Vector The vector contains the following elements:
  • Mail server - Home mail server for the specified person.
  • Build number - 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, an empty string.
  • Domino® version - 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, a null string.
  • Mail file - Mail file for the specified person.
  • Short name - Short form of the specified person's name.
  • Mail domain - Notes® Domain of the specified person's mail address.
  • User name - First entry in the list of user names honored for the specified person.
  • Internet mail address - Internet mail address for the specified person.
  • Out of Office - Out of Office service type. "1" indicates Agent, "2" indicates Service.

Usage

For directory lookups of mail information, the resident server specified for the directory class instance will be used, if present. If that fails, bootstrap information for the method will be gleaned from the user's current operating environment.

If errorOnMultipleMatches is true, and multiple matches for the same name are found, the error code that is thrown is error code 4751 "Directory contains multiple entries for this user."

If no server responds to the lookup requests, the error code that is thrown is error code 4749 "Unable to access server."

If username was not found in the directory, the error code that is thrown is error code 4731 "User not found in Directory."

If the method fails for any other reason, the error code that is thrown is error code 4730 "GetMailInfo failed."

If getver is true and the specified person's home server is not available, BuildNumber and DominoVersion will be left blank.

Examples

This button gets mail information for the current user.
var dir:NotesDirectory = session.getDirectory("tornado/UNIX/Notes");
var mailinfo = dir.getMailInfo(session.getUserName(), true, true);
requestScope.status = requestScope.status + "\nMail server: " + mailinfo[0];
requestScope.status = requestScope.status + "\nBuild number: " + mailinfo[1];
requestScope.status = requestScope.status + "\nDomino version: " + mailinfo[2];
requestScope.status = requestScope.status + "\nMail file: " + mailinfo[3];
requestScope.status = requestScope.status + "\nShort name: " + mailinfo[4];
requestScope.status = requestScope.status + "\nMail domain: " + mailinfo[5];
requestScope.status = requestScope.status + "\nUser name: " + mailinfo[6];
requestScope.status = requestScope.status + "\nInternet mail address: " + mailinfo[7];
requestScope.status = requestScope.status + "\nOut of office type: " + 
	(mailinfo[8] == 1 ? "Agent" : "Service");