Beispiel #1
0
 public static void StopSmtpServer()
 {
     SmtpServer.MessageReceived -= SmtpServer_MessageReceived;
     SmtpServer.ClearReceivedEmail();
     SmtpServer.Stop();
     IsSmtpServerOn = false;
 }
Beispiel #2
0
        private static void SmtpServer_MessageReceived(object sender, MessageReceivedArgs e)
        {
            if (ReceivedEmails.Count == MaximumLimit)
            {
                ReceivedEmails.RemoveAt(ReceivedEmails.Count - 1);
            }

            var newEmailId = (ReceivedEmails.Count == 0) ? 1 : ReceivedEmails[0].Id + 1;

            ReceivedEmails.Insert(0, new Email(e.Message, newEmailId));

            SmtpServer.ClearReceivedEmail();
        }
Beispiel #3
0
        private static void SmtpServer_MessageReceived(object sender, MessageReceivedArgs e)
        {
            Inbox.Receive(new Email(e.Message));

            SmtpServer.ClearReceivedEmail();
        }