错误C#邮件客户端 [英] Error C# mail client

查看:88
本文介绍了错误C#邮件客户端的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我尝试使用 C#创建电子邮件客户端(Windows窗体应用程序)这是我的代码

创建服务器部件时发生错误



 Server =  new  TcpClient(POPServ.Text, 110 );  //  错误来自没有这样的主机已知 
NetStrm = Server.GetStream( );
RdStrm = new StreamReader(Server.GetStream());





POP服务器 - pop.gmail.com

用户名传递正确

pop port - < b> 110

i所有使用 995 但同样的事情发生

什么是共鸣

谢谢提前

解决方案

请参阅我对该问题的评论。只需在调试器下运行它并检查 POPServ.Text 的值。修复主机名/地址并确保服务器端实际运行。



-SA


< blockquote>您必须添加您的凭据( SmtpClient.Credentials ),并设置 EnableSsl 属性。


I try to create a email client using C# (Windows Form application) this is my code
there is an error occurred when create server part

Server = new TcpClient(POPServ.Text,110); // error comes here "No such host is known"
NetStrm = Server.GetStream();
RdStrm= new StreamReader(Server.GetStream());



POP server - pop.gmail.com
user name pass are correct
pop port - 110
i allso use 995 but same thing happen
what is the reson
Thank in advance

解决方案

Please see my comment to the question. Just run it under the debugger and check up the value of POPServ.Text. Fix the host name/address and make sure your server side is actually running.

—SA


You have to add your credentials (SmtpClient.Credentials), and set the EnableSsl property.


这篇关于错误C#邮件客户端的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆