Avoiding an Outlook Security Warning When Reading an Outlook Message from a C # Program

I have a requirement to read the subject, sender address and message body of a new message in my Outlook inbox from C #. But I get a security warning. "The program is trying to access the email addresses that you saved in Outlook. Do you want to allow this?

On some search engines, I found several third-party COM libraries to avoid this. But I'm looking for a solution that does not require any third-party COM library.

+14
c # outlook
Oct 24 '08 at 20:56
source share
7 answers

Sorry, I had this nasty problem in the add-ins of Outlook 2003 and Outlook 2007, and the only solution that worked was to purchase Redemption . As far as I remember, in Outlook 2007 this annoying pop-up should only appear if your firewall is turned off or your antivirus software is out of date.

+10
Oct 24 '08 at 21:14
source share

I encountered the same issue when accessing the sender email address for an Outlook mail item. To avoid a "security warning", do not create a new application object, use Globals.ThisAddIn.Application instead to create a new mail file.

string GetSenderEmail(Outlook.MailItem item) { string emailAddress = ""; if (item.SenderEmailType == "EX") { Outlook.MailItem tempItem = (Outlook.MailItem)Globals.ThisAddIn.Application.CreateItem(Outlook.OlItemType.olMailItem); tempItem.To = item.SenderEmailAddress; emailAddress = tempItem.Recipients[1].AddressEntry.GetExchangeUser().PrimarySmtpAddress.Trim(); } else { emailAddress = item.SenderEmailAddress.Trim(); } return emailAddress; } 
+15
Jul 28 '09 at 22:55
source share

try it

Tools β†’ Macro β†’ Security β†’ Program Access

Then select Never warn me about suspicious activity.

+5
May 02 '09 at 2:56
source share

"But I'm looking for a solution that does not require any third-party COM library."

You will not find it. Casper has already pointed out the only solution that I know of. Redemption is the only thing that supports Outlook plugins and code to work. I have made commercial Outlook add-ins for Franklin Covey. We understood a lot, but the Atonement was the only thing that made us overcome this obstacle.

+3
May 02 '09 at 3:05
source share

If your application is not connected to Outlook, you can see the MAPI for reading data from the inbox

+1
Oct 24 '08 at 21:53
source share

We use Advanced Security for Outlook from Mapilab for this. It is free, also for commercial use, and still maintains Outlook security (only allowing access to approved applications). Just as for the previously mentioned solutions, which cost either money or may compromise security.

0
Oct 12 '09 at 17:44
source share

You can disable the security popup using the Outlook Trust Center. Check here .

0
Oct. 20 '09 at 17:02
source share



All Articles