Пример #1
0
        private void Items_ItemAdd(object Item)
        {
            var mail = (MailItem)Item;

            if (Item == null)
            {
                return;
            }
            if (mail.MessageClass != "IPM.Note")
            {
                return;
            }
            var eventAgrs = new NewEnailEventArgs(mail);
            var ad        = ExtractAd(mail.Body);

            if (ad != string.Empty)
            {
                eventAgrs.ContainAd = true;
                eventAgrs.Ad        = ad;
            }
            OnIncommingEmail(eventAgrs);
            //raise event
        }
Пример #2
0
 protected virtual void OnIncommingEmail(NewEnailEventArgs e)
 {
     IncommingEmail?.Invoke(this, e);
 }