套接字异常请求的地址在C#的上下文74.125.200.27:25中无效

时间:2015-03-28 07:16:14

标签: c#

TcpClient tClient = new TcpClient("gmail-smtp-in.l.google.com", 25);
string CRLF = "\r\n";
byte[] dataBuffer;
string ResponseString;
NetworkStream netStream = tClient.GetStream();
StreamReader reader = new StreamReader(netStream);
ResponseString = reader.ReadLine();


///* Perform HELO to SMTP Server and get Response */
dataBuffer = BytesFromString("HELO Congnition Infosystem Here" + CRLF);
netStream.Write(dataBuffer, 0, dataBuffer.Length);
ResponseString = reader.ReadLine();
dataBuffer = BytesFromString("MAIL FROM:<pachirit99@gmail.com>" + CRLF);
netStream.Write(dataBuffer, 0, dataBuffer.Length);
ResponseString = reader.ReadLine();

在编译器执行TcpClient ## Heading ##行时,它显示为the requested address is not valid in its context 74.125.200.27:25 ....如何解决这个问题?

0 个答案:

没有答案