<%@LANGUAGE="JAVASCRIPT" CODEPAGE="1252"%> xmail.eye-catcher.com [eyeXMail Documentation]
eyeXMail Documentation
Version 1.4
Release Date:: 2002/9/26
Project By: Shawn Anderson <sanderson@eye-catcher.com>
Web Site: http://xmail.eye-catcher.com
Download Site: http://xmail.eye-catcher.com/files/tools/eyeXMail/eyeXMail.zip

History
2002/9/26 1.4
  • Added a Connect and Disconnect property so that multiple commands can be send on a single connection.
2002/8/10 1.3
  • Fix a timeout issue with commands that do not return a result set
2002/7/9 1.1
  • Fixed the Results property for IIS 4
  • Added the SortResults method to allow the resorting of the data
2002/7/5 1.0 Initial Release
Interface Documentation
Properties
Name ServerAddress
Data Type String
Parameters  
Example xmail.ServerAddress = "127.0.0.1";
Description  

Name ServerPort
Data Type Number
Parameters  
Example xmail.ServerPort = 6017;
Description  

Name ServerUser
Data Type String
Parameters  
Example xmail.ServerUser = "root";
Description  

Name ServerPassword
Data Type String
Parameters  
Example xmail.ServerPassword = "password";
Description  

Name UseMD5
Data Type Number
Parameters  
Example xmail.UseMD5 = true;
Description  

Name ResultCode
Data Type Number
Parameters  
Example if (xmail.ResultCode != 0)
Description  

Name ResultsRaw
Data Type String
Parameters  
Example Response.Write(xmail.ResultsRaw);
Description Return the results in there original format. This is exactly the way the CTRLCLNT would return them.

Name Results
Data Type Array(Collection) of Strings
Parameters
Index Number The line in the result set to return
Example

Response.Write(xmail.Results(0)(0));
Note: See examples below for more information

Description This method returns an array (collection) for the request line.

Name ResultCount
Data Type Number
Parameters  
Example Response.Write("Total Number of Lines: " + xmail.ResultCount);
Description The number of lines that where returned by the command

Methods
Name Connect
Data Type N/A
Parameters N/A
Example xmail.Connect();
Description

This command will connect yout to the specifed XMail CTRL server.
Note: You must specify a Server, Port, UserName, and Password before calling this.


Name Disconnect
Data Type N/A
Parameters N/A
Example xmail.Disconnect();
Description

This command will disconnect yout from the specifed XMail CTRL server.


Name ExecuteCommand
Data Type N/A
Parameters
Command String Any valid xmail ctrlclnt command
Parameters String The parameters for the specified xmail command, seperated by a CR & LF character (\r\n, vbCR + vbLF)
PostData String Any extra data for the xmail command. For ex: the cfg file data
SortIndex Number The index for the column that the result data should be sorted by
Example xmail.ExecuteCommand("userlist", "eye-catcher.com\r\nroot", "", 1);
Description This command will sent the request information to the XMail CTRL server and wait from a response if necessary.
Note: If you are not connected to the server already, this command will do the connect and disconnect for you. If you have already called connect before, the connection will remain open.

Name SortResults
Data Type N/A
Parameters
Index Number The Column to sort the result set on.
Example xmail.SortResults(2);
Description The can be used to resort the result set without having to request the data from the server again.

Examples
JavaScript
	
var xmail = Server.CreateObject("eyeXMail.ctrlclnt");
var sLine;
var c;

xmail.ServerAddress	= "127.0.0.1";
xmail.ServerPort = 6017;	
xmail.ServerUser = "root";
xmail.ServerPassword = "password";
xmail.UseMD5 = true;
xmail.ExecuteCommand("userlist", "foo.bar", "", 1);

Response.Write("Result Count: " + xmail.ResultCount + "<BR>");
for (i=0; i<xmail.ResultCount; i++)
{
	Response.Write("Line #" + i + ": ");

	var arrayVariants = new VBArray(xmail.Results(i));
	var arrayBSTR = arrayVariants.toArray();
	
	for (l= arrayVariants.lbound();l<= arrayVariants.ubound(); l++) 
	{
		Response.write(arrayBSTR[l] +", ");
	}

	Response.Write("<BR>");
}

Response.Write("Done...<BR>");

VBScript
Dim xmail

set xmail = Server.CreateObject("eyeXMail.ctrlclnt")

xmail.ServerAddress = "127.0.0.1"
xmail.ServerPort = 6017
xmail.ServerUser = "root"
xmail.ServerPassword = "password"
xmail.UseMD5 = TRUE

xmail.ExecuteCommand("userlist", "foo.bar", "", 1)

for i = 0 to xmail.ResultCount
 	sLine = xmail.Results(i)
		
 	for each c in sLine
 		Response.Write c & ", "
 	next
	
 	Response.Write "<BR>"
	
next
}
PHP
$ctrlclnt = new COM("eyeXMail.ctrlclnt") or 
	die("Unable to instanciate ctrlclnt");

$ctrlclnt->ServerAddress 	= "127.0.0.1";
$ctrlclnt->ServerPort 		= 6017;
$ctrlclnt->ServerUser 		= "root";
$ctrlclnt->ServerPassword  	= "password";
$ctrlclnt->UseMD5  			= true;

$result = $ctrlclnt->ExecuteCommand("userlist", "foo.bar", "", 1);

echo "Raw Results: \n" . $ctrlclnt->ResultsRaw() . "\n";

$count 	= $ctrlclnt->ResultCount;

echo "Account Names: \n";
for ($i = 0; $i < $count; $i++)
{
	$line = $ctrlclnt->Results($i);
	echo $i . " " . $line[1] . "\n";
}

$ctrlclnt = null;