Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

ItemAddEvent not firing with Redemption - Outlook freezing

Posted on 2008-06-11
2
Medium Priority
?
675 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

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Question has a verified solution.

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

This article describes how to import an Outlook PST file to Office 365 using a third party product to avoid Microsoft's Azure command line tool, saving you time.
With so many activities to perform, Exchange administrators are always busy in organizations. If everything, including Exchange Servers, Outlook clients, and Office 365 accounts work without any issues, they can sit and relax. But unfortunately, it…
In this Experts Exchange video Micro Tutorial, I'm going to show how small business owners who use Google Apps can save money by setting up what is called a catch-all email address in their Gmail accounts. By using the catch-all feature, small busin…
Many of my clients call in with monstrous Gmail overloading issues with Outlook. A quick tip is to turn off the All Mail and Important folders from synching. Here is a quick video I made to show you how to turn off these and other folders in Gmail s…

636 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