Example #1
0
        void Mail_Sent(object sender, MailReceivedEventArgs e)
        {
            //Logger.Log.DebugFormat("{0} ->{1},from:{2},subject:{3},{4}", e.Item.ReceivedTime, e.Item.EntryID,
            //           e.MailItem.OutlookMailItem.SenderName, e.MailItem.OutlookMailItem.Subject, Environment.NewLine);

            TagMailItem(e.MailItem);
        }
Example #2
0
        void SyncItems_ItemSync(object sender, SyncItem e)
        {
            // Use this event to handle all incoming e-mails

            var outlookMailItem = MailHelper.GetMailItemFromId(this.BaseAddIn.OutlookApp, e.EntryID);

            var eventArg = new MailReceivedEventArgs
            {
                Item=e,
                OutlookApplication=this.BaseAddIn.OutlookApp,
                //OutlookMailItem = outlookMailItem,
                MailItem=new AOMailItem(outlookMailItem)
            };

            if (MailHelper.IsSentItem(outlookMailItem))
            {
                if (MailSent != null)
                {
                    MailSent(this, eventArg);
                }
            }
            else
            {
                if (MailReceived != null)
                {
                    MailReceived(this, eventArg);
                }
            }
        }