Create Mailbox using ASP.NET

Posts: 844
Joined: Mon Dec 05, 2005 7:51 am
Location: Canada

Create Mailbox using ASP.NET

Postby rockinthesixstring » Tue Oct 21, 2008 4:16 am

Can someone tell me how to create a new mailbox in ASP.NET? I tried looking at the documentation but couldn't find what I was looking for.

Does 3.5 have a nice handy web service like SM so that mailboxes can be created from servers that are separate from the Email server?

If not... I suppose I would like to post this as a suggestion.
Server 2008 Standard (x64)
ME Ent 6.51 (SQL Server 2008 Config)
ASSP 1.9

Posts: 1
Joined: Thu Dec 18, 2003 11:59 am

Postby tametcalfe » Fri Nov 07, 2008 6:07 pm


This is something I'm sure alot of developers would find useful. Anyone out there know how to achieve this?



Posts: 6
Joined: Wed Jan 14, 2009 12:48 pm

Postby priyappated » Thu Jan 15, 2009 12:03 pm

Hi I have put some code here if it can help you,

MailEnable.Administration.Mailbox mailBoxCreate = new MailEnable.Administration.Mailbox();

mailBoxCreate.Postoffice = "PostOfficeName";
mailBoxCreate.Mailbox = "MailBoxName";//Name you want for mailbox
mailBoxCreate.RedirectAddress = "";
mailBoxCreate.RedirectStatus = 0;
mailBoxCreate.Status = 1;
mailBoxCreate.Limit = -1; //-1 for unlimited

int mailResult = mailBoxCreate.AddMailbox();

Posts: 20
Joined: Mon Jan 11, 2010 9:35 pm

Re: Create Mailbox using ASP.NET

Postby mattblack » Wed Jan 13, 2010 3:04 pm

Can someone please help with this? I'm new to (Though very experienced with ASP and IIS) and I just can't get this code snippet working.

I desperately need a way to create and delete mailboxes from IIS before i buy ME.

If I try this code as-is, in a Page_Load sub, I get...

Compiler Error Message: BC30451: Name 'MailEnable' is not declared.

Is there some kind of namespace I have to import? I've tried copying the files from MEWebAdmin but they import a file (like "UserWizard1.aspx.vb") which doesn't exist - so I can't even see how it's done there.

PLEASE will someone help!

Posts: 20
Joined: Mon Jan 11, 2010 9:35 pm

Re: Create Mailbox using ASP.NET

Postby mattblack » Wed Jan 13, 2010 5:37 pm

Think I've figured it out!! Copied the BIN folder from the MEWebAdmin and added every dll i could find on the resources page online. See to be at least doing something now.

Watch this space!

Site Admin
Posts: 4441
Joined: Tue Jun 25, 2002 3:03 am
Location: Melbourne, Victoria Australia

Re: Create Mailbox using ASP.NET

Postby MailEnable » Thu Jan 14, 2010 1:08 pm

You should not need to copy any files from the MailEnable BIN directory into your application's Bin/Executable directory.

You should simply download and use the Administration Assembly from (Any other DLLs will be found by the assembly via searching your windows path statement for them).

To get started, I suggest that you first get familiar with developing a simple VB.NET application to trial using the API. You can download the necessary assemboly from this zip file: ...
This zip file should get you started with a VB.Net desktop application:

Once you have done this, you can create a web project in Visual Studio and add the DLL as a reference to your project.

The admnistration assembly is strongly typed and remotable (so it is possible to use the assembly on one machine and to to add a mailbox on another machine).
Regards, Andrew

Posts: 20
Joined: Mon Jan 11, 2010 9:35 pm

Re: Create Mailbox using ASP.NET

Postby mattblack » Thu Jan 14, 2010 4:35 pm

Thanks for the reply Andrew.

I've spent a couple of days learning .net and the Visual Web Developer tool (Which is brilliant!!). Spent a lot of time tearing my hair out because I couldn't get the namespace/dll files right and so nothing was being recognised. All these include-files were driving me mad.

But anyhow, I've done it! I've created an aspx page (With a .vb include file) that I can call from a URL, with an action=Create/Disable/Enable, username=xxxxx, password=xxxxx parametres and it works perfectly!

I still think you need to get some aspx files online to show people how it's done... took me a long time to figure this out (About 26 hours full-on, which would have been more like 4 hours if I'd had examples to work with).

Also, the documentation seriously needs more information. Like about the GetLogin() for example, if you don't give a status then it doesn't work right (but what if you want to pull any account whether it's enabled or not?). The docs should tell you what fields are required and there should be more information about each function (And again, more examples! There's very few examples in the reference files).

It would take your team of programmers no time at all to get some examples made up, and I think the majority of ME customers are trying to create web applications (Why would I want to make my own desktop app when i can use the ME app?).

Thanks again!

Posts: 6
Joined: Tue Sep 27, 2011 7:31 pm

Re: Create Mailbox using ASP.NET

Postby DeShark » Fri Sep 30, 2011 8:34 pm


Care to share what you've created? I think ME needs a public opensource webservice project for all to share.


Posts: 1
Joined: Sun Mar 18, 2012 1:16 am

Re: Create Mailbox using ASP.NET

Postby AUZSOLUTIONS » Sun Mar 18, 2012 1:18 am

Hi Matt,

Are you interested in sharring what you have done?


Posts: 2
Joined: Fri Aug 08, 2014 9:56 am

Re: Create Mailbox using ASP.NET

Postby dananos » Fri Aug 08, 2014 10:00 am

Can anyone offer any advice on how to set up permissions in IIS to get a webpage to set up a new mailbox in mailenable?

I've tried using the sample "Classic ASP" script "addmailbox.asp" downloaded from Mailenable, but when I run it, I get

Server object error 'ASP 0178 : 80070005'

Server.CreateObject Access Error

/addmailbox.asp, line 19

The call to Server.CreateObject failed while checking permissions. Access is denied to this object.

- The Application Pool is running under LocalSystem account, and IIS is in 32 bit mode. Mailenable is running fine otherwise, and I have access to email.

Please Help!

Who is online

Users browsing this forum: No registered users and 2 guests