/// <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); } }
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); } }