How to use DomainBlacklist (or equlivalent) for add, get, & delete

sweinberger
Posts: 1
Joined: Sun Jan 18, 2015 6:21 pm

How to use DomainBlacklist (or equlivalent) for add, get, & delete

Postby sweinberger » Mon Jan 19, 2015 3:30 am

I am new to coding to the MailEnable and the manuals were not clear.

Environment: .Net (C# in particular, but I can read VB easily too)

I would like to retrieve (get) the entire domain blacklist, add an IP address(es) to the domain blacklist, and delete a listed IP address from the domain blacklist. What would be the code?

I got as far as the following, but did not see how to use what I have:

Code: Select all

using System;
using System.Collections.Generic;
using System.Linq;
using MailEnable.Administration;

namespace MyNamespace
{
   class myClass
   {
      public static Boolean GetBlacklistEntries(out String[] BlacklistIps)
      {
         // Initialize: Output
         BlacklistIps = null;

         try
         {
            // Create a login to the service.
            Login oLogin = new Login()
            {
               UserName = ServiceUsername,
               Password = ServicePassword,
               Host = ServiceUrl,
            };

            int idLogin = oLogin.GetLogin();

            // Get: Blacklist
            DomainBlacklist oBlacklist = new DomainBlacklist()
            {
               Host = ServiceUrl,
            };

            return true;
         }

         catch (Exception ex)
         {
              ...
         }

         return false;
      }
   }
}


There would be presumably something similar for add and delete.

My problem is that I did not see a doLogin method or any useful response, which I would pass to the DomainBlacklist() class. I saw the Host/SetHost property, but did not see anything else.

Who is online

Users browsing this forum: No registered users and 2 guests