Solved

ItemAddEvent not firing with Redemption - Outlook freezing

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

What is SQL Server and how does it work?

The purpose of this paper is to provide you background on SQL Server. It’s your self-study guide for learning fundamentals. It includes both the history of SQL and its technical basics. Concepts and definitions will form the solid foundation of your future DBA expertise.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Export import database 4 42
SQL Exceptions 3 37
I need help making a collection from a class in VB.Net 3 25
Parsing error when installing an Outlook Add-in 2 17
Follow this checklist to learn more about the 15 things you should never include in an email signature from personal quotes, animated gifs and out-of-date marketing content.
This article lists the top 5 free OST to PST Converter Tools. These tools save a lot of time for users when they want to convert OST to PST after their exchange server is no longer available or some other critical issue with exchange server or impor…
The purpose of this video is to demonstrate how to set up a Mailchimp campaign. This will include styling and adding elements to a newsletter/email. This will be demonstrated using a Windows 8 PC. Mailchimp will be used. Log into your Mailchim…
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…

911 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

Need Help in Real-Time?

Connect with top rated Experts

20 Experts available now in Live!

Get 1:1 Help Now