//建立连接 Socket socket = new Socket(AddressFamily.InterNetwork, SocketType.Stream, ProtocolType.Tcp); IPAddress ipa = Dns.GetHostEntry("smtp.sina.com").AddressList[0]; socket.Connect(ipa, 25); ns = new NetworkStream(socket); buffer = new byte[512]; ns.Read(buffer, 0, buffer.Length); output(buffer); string host = Dns.GetHostName(); string cmd = "EHLO " + host + "\r\n"; buffer = Encoding.Default.GetBytes(cmd.ToCharArray()); ns.Write(buffer, 0, buffer.Length); buffer = new byte[512]; ns.Read(buffer, 0, buffer.Length); output(buffer); buffer = Encoding.Default.GetBytes("AUTH LOGIN\r\n".ToCharArray()); ns.Write(buffer, 0, buffer.Length); buffer = new byte[512]; ns.Read(buffer, 0, buffer.Length); output(buffer); buffer = Base64Encode("邮箱用户名\r\n"); output(buffer); ns.Write(buffer, 0, buffer.Length); output(buffer); buffer = new byte[512]; //程序停止在此处 ns.Read(buffer, 0, buffer.Length); output(buffer);请教高手!!!