mdailor
  • mdailor
  • 51.5% (Neutral)
  • Newbie Topic Starter
8 months ago
Hello,
I am attempting to validate an email address using the C# code sample in a .NET 7.0 web app running on Windows IIS. The call to SmtpClient.TestRecipients fails every time with the following error:

A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond.

My code:

SmtpMail oMail = new SmtpMail("TryIt");
SmtpClient oSmtp = new SmtpClient();
oMail->From = "thor-no-reply@targethospitality.com;
oMail->To = "does-not-exist@nextwavesoftware.com";
SmtpServer oServer = new SmtpServer("");
try
{
oSmtp->TestRecipients(oServer, oMail);
Console::WriteLine("email address was verified!");
}
catch (Exception ep)
{
Console::WriteLine("failed to test email address with the following error:");
Console::WriteLine(ep->Message);
}



Thank you for your help.
ivan
  • ivan
  • 100% (Exalted)
  • Administration
8 months ago
It is likely that your outbound 25 port is blocked, in this way, there is no way to test recipient.
mdailor
  • mdailor
  • 51.5% (Neutral)
  • Newbie Topic Starter
8 months ago
Thanks for your reply, Ivan, I will give that a try.

EXPLORE TUTORIALS

© All Rights Reserved, AIFEI Software Limited & AdminSystem Software Limited.