?
Solved

ItemAddEvent not firing with Redemption - Outlook freezing

Posted on 2008-06-11
2
Medium Priority
?
664 Views
Last Modified: 2013-12-17
I had a piece of code which allow me to make special actions on new mails which arrived in a public folder. But as i asked for the SenderName, i had the outlook security window which appeard every ten minutes. To get out of this problem, i have installed redemption, and change the code. The code is no more working. In fact, as soon as a new mail arrive i cant access Outlook anymore, its freezing.

I post the old and the new code, to see if someone can find the issue.

Thanks for assistance

#################################################
########## THE OLD ONE W/O REDEMPTION ###########
#################################################
 
public void ReceptionMail(Outlook.Application o)
        {
            Outlook.MAPIFolder fldInbox;
            Outlook.NameSpace olNs;
            olNs = o.GetNamespace("MAPI");
            fldInbox = olNs.GetDefaultFolder(Outlook.OlDefaultFolders.olPublicFoldersAllPublicFolders).Folders["Blabla"];
 
            fldInbox.Items.ItemAdd += new Outlook.ItemsEvents_ItemAddEventHandler(Items_ItemAdd);
 
            Console.WriteLine("Please wait for new messages...");
            Console.ReadLine();
        }
 
        private void Items_ItemAdd(object Item)
        {
            Console.WriteLine("New Message")
        }
 
#########################################################
############### THE NEW CODE W REDEMPTION ###############
#########################################################
 
 public void ReceptionMail(Outlook.Application o)
        {
            RDOFolder fldInbox;
            Outlook.NameSpace olNs;
            olNs = o.GetNamespace("MAPI");
            Redemption.RDOSessionClass rdoSession = new Redemption.RDOSessionClass();
            rdoSession.MAPIOBJECT = olNs.MAPIOBJECT;
            fldInbox = rdoSession.GetDefaultFolder(rdoDefaultFolders.olPublicFoldersAllPublicFolders).Folders["Blabla"];
            fldInbox.Items.ItemAdd += new IRDOItemsEvents_ItemAddEventHandler(Items_ItemAdd);
 
            Console.WriteLine(fldInbox.Items.Count);
            Console.WriteLine("Please wait for new messages...");
            Console.ReadLine();
        }
 
        public void Items_ItemAdd(object Item)
        {
           Console.WriteLine("New Message")
        }

Open in new window

0
Comment
Question by:Emzed
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 28

Accepted Solution

by:
peakpeak earned 1000 total points
ID: 21761887
There's a better solution (IMHO). You use a script that put the mail in the Outbox:
http://www.everythingaccess.com/tutorials.asp?ID=Outlook-Send-E-mail-without-Security-Warning
0
 

Author Comment

by:Emzed
ID: 21777911
Find how to solve this matter,

Use SafePostItem with the first code

            SafePostItem postitem = new SafePostItemClass();
            postitem.Item = Item;
            TraitementMail(postitem);
0

Featured Post

The Orion Papers

Are you interested in becoming an AWS Certified Solutions Architect?

Discover a new interactive way of training for the exam.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article describes how to import Lotus Notes Contacts into Outlook 2016, 2013, 2010 and 2007 etc. with a few manual steps. You can easily export and migrate Lotus Notes contacts into Microsoft Outlook without having to use any third party tools.
We aren’t perfect, just like everyone else.  Check out the email errors our community caught and learn the top errors every email marketer should avoid.
To add imagery to an HTML email signature, you have two options available to you. You can either add a logo/image by embedding it directly into the signature or hosting it externally and linking to it. The vast majority of email clients display l…
Internet Business Fax to Email Made Easy - With eFax Corporate (http://www.enterprise.efax.com), you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, fr…
Suggested Courses

762 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question