C# 此错误原因:尝试对无法访问的网络执行套接字操作[2a00:1450:4008:c01::6c]:25

C# 此错误原因:尝试对无法访问的网络执行套接字操作[2a00:1450:4008:c01::6c]:25,c#,sockets,easendmail,C#,Sockets,Easendmail,我正在尝试从C#桌面应用程序发送电子邮件,为此我参考了此页面http://www.emailarchitect.net/easendmail/kb/csharp.aspx?cat=0这是我的代码,但它给了我以下例外 尝试对无法访问的网络执行套接字操作[2a00:1450:4008:c01::6c]:25 在这条线上 oSmtp.SendMail(oServer,oMail) 我错在哪里 private void sendmail() { SmtpMail

我正在尝试从C#桌面应用程序发送电子邮件,为此我参考了此页面
http://www.emailarchitect.net/easendmail/kb/csharp.aspx?cat=0
这是我的代码,但它给了我以下例外

尝试对无法访问的网络执行套接字操作[2a00:1450:4008:c01::6c]:25

在这条线上

oSmtp.SendMail(oServer,oMail)
我错在哪里

private void sendmail()
        {
            SmtpMail oMail = new SmtpMail("TryIt");
            EASendMail.SmtpClient oSmtp = new EASendMail.SmtpClient();

            oMail.From = "mo@gmail.com";

            oMail.To = "mo@gmail.com";

            oMail.Subject = "test email from c# project";

            oMail.TextBody = "this is a test email sent from c# project, do not reply";

            // Your SMTP server address
            SmtpServer oServer = new SmtpServer("smtp.gmail.com");

            // User and password for ESMTP authentication,            
            oServer.User = "mo@gmail.com";
            oServer.Password = "account password here";   


            try
            {
                Console.WriteLine("start to send email ...");
                oSmtp.SendMail(oServer, oMail);//getting error here
                Console.WriteLine("email was sent successfully!");
            }
            catch (Exception ep)
            {
                Console.WriteLine("failed to send email with the following error:");
                Console.WriteLine(ep.Message);
            }

似乎套接字已关闭
SmtpMail
已被弃用。我应该如何使其工作?@DanielA.White是的,现在可以工作了我引用了链接u建议