1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
|
/// <summary>
/// Check if the URL is valid.
/// </summary>
/// <param name="smtpHost">The URL.</param>
/// <returns></returns>
public static bool IsUrlValid(string smtpHost)
{
bool response = false;
try
{
IPHostEntry ipHost = Dns.Resolve(smtpHost);
response = true;
}
catch (SocketException se)
{
response = false;
}
return response;
}
|