|
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
HostUserName
HostPassword
OwnerName - user name whose mail domains you want to retrieve, can be set to Host Name for getting all records
OptionalParam
WebsiteName - sent when you want to get mail domains under a particular website
MailDomainName - search filter
Language
Output Parameters
MailDomainID - a unique identification number given to each mail domain
MailDomainName
Creator - Reseller Name, returned if OwnerName parameter is set to Host Name
Owner - Webadmin Name, returned if OwnerName parameter is set to Reseller Name
IPAddress - IPAddress of associated website in case of IP Based and "Virtual" in case of NameBased
ServerName - name of the sever on which mail domain is physically created
ServerIP - IP of the sever on which website is physically created
MailAccessURL - web access of mail domain
AdminURL - administrator interface URL
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>