예제 #1
0
        static void Main(string[] args)
        {
            SmtpMock mock = new SmtpMock();

            mock.Started  += new SmtpMock.StartHandler(mock_Start);
            mock.Error    += new SmtpMock.ExceptionHandler(Exception);
            mock.Sent     += new SmtpSession.DataHandler(mock_Sent);
            mock.Received += new SmtpSession.DataHandler(mock_Received);
            mock.End      += new SmtpSession.EndHandler(mock_End);
            mock.Start();
            mock.Wait();
        }
예제 #2
0
 static void mock_Start(SmtpMock sender, TcpListener listener)
 {
     Console.WriteLine("== Listening on {0}", listener.LocalEndpoint);
 }
예제 #3
0
 static void Exception(SmtpMock mock, Exception ex)
 {
     Console.WriteLine(ex.Message);
 }