Welcome Guest! To enable all features please Login or Register.

Notification

Icon
Error

Options
Go to last post Go to first unread
mdailor  
#1 Posted : Monday, December 23, 2024 12:55:16 PM(UTC)
mdailor

Rank: Newbie

Groups: Registered
Joined: 12/23/2024(UTC)
Posts: 0
United States

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:

Quote:
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  
#2 Posted : Monday, December 23, 2024 10:36:20 PM(UTC)
ivan

Rank: Administration

Groups: Administrators
Joined: 11/11/2010(UTC)
Posts: 1,154

Thanks: 9 times
Was thanked: 55 time(s) in 55 post(s)
It is likely that your outbound 25 port is blocked, in this way, there is no way to test recipient.
mdailor  
#3 Posted : Tuesday, December 24, 2024 6:50:05 AM(UTC)
mdailor

Rank: Newbie

Groups: Registered
Joined: 12/23/2024(UTC)
Posts: 0
United States

Thanks for your reply, Ivan, I will give that a try.
Users browsing this topic
Guest (2)
Forum Jump  
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.

Powered by YAF.NET | YAF.NET © 2003-2025, Yet Another Forum.NET
This page was generated in 0.053 seconds.

EXPLORE TUTORIALS

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