0
我嘗試使用此dll:http://www.eggheadcafe.com/articles/20050129.asp,但無法正常工作。運行時我總是超時。任何人都知道任何好的DLL或C#示例如何檢查郵件的DNS MX是否存在?郵件的MX驗證
代碼:
private static bool CheckDnsEntry(string domain)
{
string[] dnsServer = DnsMx.GetMXRecords(domain);
if (dnsServer.Length > 0)
{
return true;
}
return false;
}
string[] emailparts = email.Split('@');
if (CheckDnsEntry(emailparts[1]))...
錯誤:
Server Error in '/' Application.
Connection timeout
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details: System.ComponentModel.Win32Exception: Connection timeout
Source Error:
Line 462: private static bool CheckDnsEntry(string domain)
Line 463: {
Line 464: string[] dnsServer = DnsMx.GetMXRecords(domain);
Line 465: if (dnsServer.Length > 0)
Line 466: {
你可以發佈您的調用代碼和調用堆棧例外? –
Uwe我更新了我的問題 – senzacionale
也許你的防火牆阻止訪問DNS? –