Solved

ItemAddEvent not firing with Redemption - Outlook freezing

Posted on 2008-06-11
2
622 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

Live: Real-Time Solutions, Start Here

Receive instant 1:1 support from technology experts, using our real-time conversation and whiteboard interface. Your first 5 minutes are always free.

Question has a verified solution.

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

Finding original email is quite difficult due to their duplicates. From this article, you will come to know why multiple duplicates of same emails appear and how to delete duplicate emails from Outlook securely and instantly while vital emails remai…
In this step by step procedure, you will come to know the details of creating an Outlook meeting in 2007, 2010, 2013 & 2016.
This tutorial gives a high-level tour of the interface of Marketo (a marketing automation tool to help businesses track and engage prospective customers and drive them to purchase). You will see the main areas including Marketing Activities, Design …
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …

776 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