示例#1
0
        public static void WriteLineSMTP(this TCPConnection TCPConn, SMTPStatusCode StatusCode, params String[] Response)
        {
            var n = (UInt64)Response.Where(line => line.IsNotNullOrEmpty()).Count();

            Response.
            Where(line => line.IsNotNullOrEmpty()).
            ForEachCounted((response, i) => {
                TCPConn.WriteLineToResponseStream(((Int32)StatusCode) + (i < n ? "-" : " ") + response);
                Debug.WriteLine(">> " + ((Int32)StatusCode) + (i < n ? "-" : " ") + response);
            });

            TCPConn.Flush();
        }