Using .NET Admin Assembly across a Network

Discussion for developers using MailEnable.
Post Reply
michaelj
Posts: 11
Joined: Wed Jan 18, 2006 1:39 am

Using .NET Admin Assembly across a Network

Post by michaelj » Mon Jan 23, 2006 11:22 pm

QUESTION: How do I administer MailEnable using the .NET Admin Assembly (MailEnable.Admin.dll) across a network?

I've installed MailEnable Pro on my local system and I am able to configure it (i.e. Add/Delete Mailboxes) when I run the code on my local system. In order to do this I set the Host to "localhost".

Example:

Code: Select all

//---Create Mailbox Object---
Mailbox mb = new Mailbox();
mb.Host = "localhost";
mb.Postoffice = "BNI";
mb.Limit = -1;
mb.Mailbox = userid;
mb.RedirectAddress = "";
mb.RedirectStatus = 0;
mb.Status = 1;

if (mb.AddMailbox() == 1)
{
 ...
}
HOWEVER, when I run the same code on another computer, and change the host appropriately, the line mb.AddMailbox() fails (i.e. It returns zero)!

Example:

Code: Select all

//---Create Mailbox Object---
Mailbox mb = new Mailbox();
mb.Host = "555.555.555.555"; //IP address of MailEnable Pro server
mb.Postoffice = "BNI";
mb.Limit = -1;
mb.Mailbox = userid;
mb.RedirectAddress = "";
mb.RedirectStatus = 0;
mb.Status = 1;

if (mb.AddMailbox() == 1)
{
 ...
}
Any thoughts? I don't have to run this code on the same machine that the server is on, do I? What port, does the communication happen on?

thanks,
Michael

P.S. The client machine is using both MailEnable.Admin.dll & MEAIPO.dll.
-
Michael

michaelj
Posts: 11
Joined: Wed Jan 18, 2006 1:39 am

Post by michaelj » Mon Jan 23, 2006 11:52 pm

Oh by the way, I'm using MailEnable Professional 1.71. So, I'm not using the Beta version.
-
Michael

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

Post by MailEnable » Fri Jan 27, 2006 10:34 pm

If you are using .net assemblies and you want to call it from a remote machine, then you should use web services/ publish it as a web service.

Unfortunately, doing this requires digging into web services/SOAP:

See: http://msdn.microsoft.com/msdnmag/issue ... ebMethods/

Examples for calling MailEnable Administration components via web services should be available within the next month or so (ie: when the release versions of V2 emerge).
Regards, Andrew

michaelj
Posts: 11
Joined: Wed Jan 18, 2006 1:39 am

Post by michaelj » Sat Jan 28, 2006 12:12 am

Thanks for your post MailEnable.

From your answer, I'm assuming that the .NET Admin Assembly (MailEnable.Admin.dll) can only administer a local MailEnable Email server (w/o delving into WebServices anyway).

So, could you please tell me what the Host public member is for? If you review my initial post, you can see that there is a public member called Host. By assigning it different IP addresses, what am I doing? What purpose does the Host member serve?
-
Michael

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

Post by MailEnable » Sat Jan 28, 2006 5:07 am

The host member is only relevant for enterprise edition since it requires the remote management service in order to communicate with a backend host. Its function is explained in the existing mailenable API as at http://www.mailenable.com/developers.

Its probably easier to look at the example in the API, but in summary, you specify the name of the host to which you have defined a remote administration session, mailenable will connect to that host accordingly. It communicates over TCP/IP, but the host->IP and credentials associated with the remote call is wrapped up in the Session object I mentioned.
Regards, Andrew

Post Reply