The prerequisites are just to install power shell on your web server and of course you need to install the Exchange Server Management Tools on the server that will execute the code.
After that you can use this function:
public static IList CreateEmail(string userName, string mail, string domain, string ou, string exDatabase)
{
//create the command
string cmd = string.Format("Enable-Mailbox -Identity '{0}/{1}/{2}' -Alias '{3}' -Database '{4}'", domain, ou, userName, mail, exDatabase);
ExchangeManagementShellWrapper ems = ExchangeManagementShellWrapper.Instance;
ICollection
IList IErrors;
results = ems.RunspaceInvoke(cmd, out IErrors);
return IErrors;
}
for source code of ExchangeManagmentShellWrapper, you can download it from internet or anyone who need it,I can send it to him by email.