Location: PHPKode > scripts > PHP DirectAdmin > php-directadmin/email_example.php
<?php
include_once('directadmin.inc.php');
error_reporting(E_ALL);

$da = new DirectAdmin('demo.com', 'c:/temp/', 'http://www.directadmin.com:2222/', 'demo_user', 'demo');

// get emails array
print_r($da -> getEmailList());

// create the new email box if needed
if (isset($_REQUEST['submit'])) {
	$da -> createEmail($_REQUEST['username'], $_REQUEST['password'], $_REQUEST['quota']);
	echo 'Account created<BR>';
}
?>
<form action="index.php" method="post" name="adminForm" id="adminForm">
<table class="adminform" border="0">

	<tr>
		<th colspan="3">Create New Email Account</th>
	</tr>
	<tr>
		<td width="20%" valign="top"><b>Username<br /><font size="1">hide@address.com</font></b></td>
		<td valign="top" dir="ltr"><input class="text_area" size="50" name="username" type="text" />@domain.com</td>

	</tr>
	<tr>
		<td width="20%" valign="top"><b>Password</b></td>
		<td valign="top"><input class="text_area" size="50" name="password" type="password" /></td>
	</tr>
	<tr>
		<td width="20%" valign="top"><b>Password Again</b></td>
		<td valign="top"><input class="text_area" size="50" name="repassword" type="password" /></td>

	</tr>
	<tr>
		<td width="20%" valign="top"><b>Email Box Size</b><br />(0 for unlimited)</td>
		<td valign="top"><input name="quota" type="text" /></td>
	</tr>
	<tr>
	  <td><input type="submit" name="submit" value="Create" ></td>
	</tr>
</table>
</form> 
Return current item: PHP DirectAdmin