function TfrmMain.GetMxList(vDns, vDomain: string): TstringList;
var
k: Integer;
IdDNS:TIdDnsResolver;
begin
Result := TstringList.Create;
IdDNS := TIdDnsResolver.Create(nil);
if vDns='' then vDns := '202.118.4.238';
IdDNS.Host := vDns;
IdDns.QueryRecords := [qtMX];
try IdDns.Resolve(vDomain);//(vDomain);
IdDns.Active;
for k := 0 to IdDns.QueryResult.Count-1 do
if IdDns.QueryResult[k] IS TMxRecord then
Result.Add(TMXRecord(IdDns.QueryResult[k]).ExchangeServer);
finally
IdDns.Free;
end;
end;