Solved

ItemAddEvent not firing with Redemption - Outlook freezing

Posted on 2008-06-11
2
633 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
2 Comments
 
LVL 28

Accepted Solution

by:
peakpeak earned 500 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

Guide to Performance: Optimization & Monitoring

Nowadays, monitoring is a mixture of tools, systems, and codes—making it a very complex process. And with this complexity, comes variables for failure. Get DZone’s new Guide to Performance to learn how to proactively find these variables and solve them before a disruption occurs.

Question has a verified solution.

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

Suggested Solutions

Large Outlook files lead to various unwanted errors and corruption issues. Furthermore, large outlook files can also make Outlook take longer to start-up, search, navigate, and shut-down. So, In this article, i will discuss a method to make your Out…
Pop culture is prime bait for hackers seeking to infect user’s computers and mobile devices with malicious malware. Hackers know exactly what the latest trends are online and know how to use them to their advantage.
Sending a Secure fax is easy with eFax Corporate (http://www.enterprise.efax.com). First, Just open a new email message.  In the To field, type your recipient's fax number @efaxsend.com. You can even send a secure international fax — just include t…
This video shows how to remove a single email address from the Outlook 2010 Auto Suggestion memory. NOTE: For Outlook 2016 and 2013 perform the exact same steps. Open a new email: Click the New email button in Outlook. Start typing the address: …

749 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