Solved

ItemAddEvent not firing with Redemption - Outlook freezing

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

Space-Age Communications Transitions to DevOps

ViaSat, a global provider of satellite and wireless communications, securely connects businesses, governments, and organizations to the Internet. Learn how ViaSat’s Network Solutions Engineer, drove the transition from a traditional network support to a DevOps-centric model.

Question has a verified solution.

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

Preparing an email is something we should all take special care with – especially when the email is for somebody you may not know very well. The pressures of everyday working life stacked with a hectic office environment can make this a real challen…
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…
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, f…

837 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