Provides data for the NewMailEvent event.
示例#1
0
 /// <summary>
 /// Raises event StoreMessage.
 /// </summary>
 /// <param name="session"></param>
 /// <param name="msgStream"></param>
 internal void OnStoreMessage(SMTP_Session session, MemoryStream msgStream)
 {
     if (this.StoreMessage != null)
     {
         NewMail_EventArgs oArg = new NewMail_EventArgs(session, msgStream);
         this.StoreMessage(this, oArg);
     }
 }
示例#2
0
        private void OnStoreMessage(object sender, NewMail_EventArgs e)
        {
            string rawSmtpMessage;

            using(StreamReader reader = new StreamReader(e.MessageStream))
            {
                rawSmtpMessage = reader.ReadToEnd();
            }
            ReceivedEmailMessage message = new ReceivedEmailMessage(rawSmtpMessage);

            lock(inbox)
            {
                inbox.Add(message);
            }
        }