
<!--- Lets set up our variables for use else where --->
<cfset OurDomain = "your.domain.here">


<P>
<h2>FIND VERSION OF GMS & CFX_NTMAIL</h2>
<cfx_ntmail 
  action="Version"
>
<cfoutput>GMS version number = #version#</cfoutput>

<P>


<h2>ADD A USER TO GMS  </h2>
<!---
    This can return the following StatusNumbers:
	4009 - The domain does not exist
	4010 - Failed addition of user (see logs)
	4011 - Exceeded number of licensed users
	4012 - Account already exists	
	4013 - Missing variable
--->

<cfx_ntmail action="Useradd"
  User="mathew"
  domain="#OurDomain#"
  type="2">

<cfoutput>
Status = #status#<br>
StatusNum = #StatusNumber#
</cfoutput>


<H2> CHANGING ATTRIBUTES OF USER</h2>
<!---
    Any attribute of an account can be changed.  Indeed,
    values that are not used by GMS could be stored here
    too if required.

    This can return the following StatusNumbers:
	4009 - The domain does not exist
	4013 - Missing variable
	4014 - No such user
--->

<!--- Lets change this user to have an autoresponder --->
<P>
<cfx_ntmail action="UserSet"
  User="mathew"
  domain="#OurDomain#"
  Variable="Type"
  Value="128"
>

<cfoutput>
Status = #status#<br>
StatusNum = #StatusNumber#
</cfoutput>


<P>
<h2>DISPLAY ATTRIBUTES OF USER</h2>
<!---
    Any attribute of an account can be obtained.

    This can return the following StatusNumbers:
	4009 - The domain does not exist
	4014 - No such user
--->
<cfx_ntmail 
  action="UserGet"
  domain="#ourdomain#"
  User="mathew"
  variable="Type"
>

<cfoutput>
User name: mathew<br>
Domain: #ourdomain#<br>
Account type: <cfif #value# is 2>POP Account</cfif><cfif #value# is 128>Autoresponder</cfif><br>
</cfoutput>

<P>
<h2>ENUMERATE USERS IN A DOMAIN</h2>
<!---
    Any attribute of an account can be obtained.

    This can return the following StatusNumbers:
	4009 - The domain does not exist
--->
<cfx_ntmail
  action="UserENum"
  domain="#ourdomain#"
>

<cfoutput>
Status = #status#<br>
StatusNumber = #StatusNumber#<br>
<cfif StatusNumber is 0>
  Value = #Variable#
</cfif>
</cfoutput>

<P>
<h2>DELETE A USER</h2>
<!---
    Any attribute of an account can be obtained.

    This can return the following StatusNumbers:
	4009 - The domain does not exist
	4014 - No such user
	4015 - Could not delete user (see logs)
--->
<cfx_ntmail
  action="UserDel"
  domain="#ourdomain#"
  User="mathew"
>

<cfoutput>
Status = #status#<br>
StatusNum = #StatusNumber#
</cfoutput>



<P>
