Mail Manager - GetMailDomains

Version: 7C

HC7 Build: 7.00.0012 and later

API Build: 1.00.0001 and later

 

Mail Manager - GetMailDomains  retrieves all mail domains under a specified owner. This web service call can be made as http://your-domain.com/HC7API/MailManager.asmx?op=GetMailDomains.

 

Input Parameters

 

Output Parameters

 

 

Sample Optional Parameters

 

<Parameters>

<Parameter Name = "WebsiteName">MyDomain.com</Parameter>

<Parameter Name = "MailDomainName">MyMailDomain</Parameter>

<Parameter Name = "Language">French</Parameter>

</Parameters>

 

Sample SOAP Request

 

 

POST /HC7API/MailManager.asmx HTTP/1.1

Host: your-domain.com

Content-Type: text/xml; charset=utf-8

Content-Length: length

SOAPAction: "http://tempuri.org/GetMailDomains"

<?xml version="1.0" encoding="utf-8"?>

<soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">

  <soap:Body>

    <GetMailDomains xmlns="http://tempuri.org/">

      <HostUserName>host</HostUserName>

      <HostPassword>host123</HostPassword>

      <OwnerName>david</OwnerName>

      <OptionalParam>xml</OptionalParam>

    </GetMailDomains>

  </soap:Body>

</soap:Envelope>

 

 

Sample HTTP Request

 

 

POST /HC7API/MailManager.asmx/GetMailDomains HTTP/1.1

Host: your-domain.com

Content-Type: application/x-www-form-urlencoded

Content-Length: length

HostUserName=host&HostPassword=host123&OwnerName=david&OptionalParam=xml

 

 

Sample C# Code

 

 

public MailManager.Response GetMailDomains(string strHostUserName, string strHostPassword, string strOwnerName)

{

         try

         {

                    MailManager.MailManager oMail = new MailManager.MailManager();

                    MailManager.Response oResponse = new MailManager.Response();

                    

                    XmlDocument oDoc = new XmlDocument();

  //Adding root node

  XmlNode xOptionalParam = oDoc.CreateNode(XmlNodeType.Element,"Parameters","");

  //Adding sub nodes

  XmlNode xParameter = oDoc.CreateNode(XmlNodeType.Element,"Parameter","");

  XmlAttribute xAttribute = oDoc.CreateAttribute("Name");

  xAttribute.Value = "WebsiteName";

  xParameter.Attributes.Append(xAttribute);

  xParameter.InnerText = "MyMailDomain";

  xOptionalParam.AppendChild(xParameter);

  .......

  .......

  .......

                    oResponse = oMail.GetMailDomains(strHostUserName, strHostPassword,

                    strOwnerName, OptionalParam); 

 

        }

        catch

        {

        }

        return oResponse;

}

 

 

Sample Response

 

 

<Response>

    <Method>GetMailDomains</Method>

    <Status>true</Status>

    <ErrorCode>74900001</ErrorCode>

    <ErrorDescription>Operation completed successfully.</ErrorDescription>

    <Result>

        <MailDomains xmlns="">

        <RecordCount>1</RecordCount>

            <RecordRow>

                <MailDomainID>136</MailDomainID>

                <MailDomainName>MyMailDomain.com</MailDomainName>

                <Creator>david</Creator>

                <IPAddress>127.0.0.1</IPAddress>

                <ServerName>abc</ServerName>

                <ServerIP>127.0.0.1</ServerIP>

                <MailAccessURL>http://MyDomain.com/meadmin</MailAccessURL>

                <MailAdminURL>http://MyDomain.com/meadmin</MailAdminURL>

            </RecordRow>

  .......

  .......

  .......

        </MailDomains>

    </Result>

</Response>