Deprecated: mysql_connect(): The mysql extension is deprecated and will be removed in the future: use mysqli or PDO instead in /home/a26f9f83/public_html/articles/includes/config.php on line 159
Removing Incoming Email in MS Exchange, C# Example > NetSparsh - Viral Content you Love & Share

Removing Incoming Email in MS Exchange, C# Example

The purpose of one of our projects was MS Exchange handler for processing incoming email.

The basic source of knowledge was this article "Developing Managed Event Sinks/Hooks for Exchange Server Store using C#" by Logu Krishnan, published to the address http://www.codeproject.com/csh arp/CsManagedEventSinksHooks.asp, and also examples from Microsoft Exchange SDK.

We utilized Synchronous Events and created the handler, which fires on OnSyncSave event. The handler creates activity record in Microsoft CRM and then removes the message in the Exchange database before the commitment:

public void OnSyncSave(IExStoreEventInfo pEventInfo, string bstrURLItem, int IFlags) { try { if (IFlags == ((int)EVT_SINK_FLAGS.EVT_SYNC_COMMITTED + (int)EVT_SINK_FLAGS.EVT_IS_DELIVERED)) {

ProcessMessage(pEventInfo, bstrURLItem, IFlags);

}

}

catch (Exception ex) {

log.Debug(ex.Message + " " + ex.StackTrace);

}

finally {

LogManager.Shutdown();

} }

For Exchange handlers debugging - it is the extremely convenient to use system log4net in RollingLogFileAppender or RemoteAppender modes (for multiple instance of COM + objects). You can read more on this subject here http://logging.apache.org/log4net/ To allow the handler incoming mail removal, it is necessary to give proper rights to the user, under which account the COM+ application runs the handler. These are rights on change of the information in user's boxes for whom it is registered (Windows 2003 Server: Active Directory Users and Computer -> Users -> Properties (for COM+ application account) -> Exchange Advanced -> Mailbox Rights). And now the code:

private void DeleteMessage(string bstrURLItem) { try {

ADODB.Connection oCn = new ADODB.Connection();

oCn.Provider = "exoledb.datasource";

oCn.Open(bstrURLItem, "", "", -1);

if(oCn.State == 1) {

log.Debug("Good Connection");

}

else {

log.Debug("Bad Connection");

}

ADODB.Record rec = new ADODB.Record();

rec.Open(bstrURLItem, oCn,

ADODB.ConnectModeEnum.adModeReadWrite,

ADODB.RecordCreateOptionsEnum.adFailIfNotExi sts,

ADODB.RecordOpenOptionsEnum.adOpenSource,

"", "");

rec.DeleteRecord(bstrURLItem, false);

rec.Close();

oCn.Close();

rec = null;

oCn = null;

}

catch (Exception ex) {

log.Debug(ex.Message + " " + ex.StackTrace);

} }

Happy customizing! Boris Makushkin

Boris Makushkin is Software Engineer in Alba Spectrum Technologies ? USA nationwide Microsoft CRM, Microsoft Great Plains customization company, based in Chicago, Boston, San Francisco, San Diego, Los Angeles, Houston, Atlanta, New York, and Miami and having locations in multiple states and internationally (www.albaspectrum.com), he is Dexterity, SQL, VB/C#.Net, Crystal Reports and Microsoft CRM SDK developer.

In The News:

This RSS feed URL is deprecated, please update. New URLs can be found in the footers at https://news.google.com/news

Forbes

Digital Transformation Reveals Limitations Of Software Packages And SaaS
Forbes
Most large enterprises were on a journey for the past 30 years where a higher and higher proportion of the core systems driving the enterprises was software packages or software as a service. Traditional wisdom for companies was “don't build – buy ...

and more »

The Verge

Microsoft alters Surface Hub 2 hardware, delays new software features to 2020
The Verge
Microsoft is unveiling hardware changes to its Surface Hub 2 today. The software giant first unveiled its 50-inch display earlier this year, with a promise of a 2019 release. While the hardware will now be released in Q2 of 2019, many of the cool new ...
Ignite 2018: Microsoft shows off Surface Hub 2 running latest WCOS softwareOnMSFT (blog)
What's next for Surface Hub 2 - Microsoft Devices BlogMicrosoft Devices Blog - Windows BlogWindows Blog

all 59 news articles »

American Software: The SaaS Narrative Collapses
Seeking Alpha
American Software has tried to frame itself as an SaaS company - but 'cloud' sales still represent less than 12% of revenue. A disappointing Q1 undercuts much of the optimism that revenue growth is set to accelerate. After a nearly 40% plunge, AMSWA ...

and more »

TOP500 News

IBM Introduces Software to Alleviate AI Bias
TOP500 News
A cancer treatment recommendation powered by machine learning may be right 98 percent of the time, but what are the liabilities of the software-maker when a misdiagnosis results in death? A less fatal, but still undesirable type of bias comes into play ...
IBM's new bias detection software, democratizing AIIT World Canada

all 6 news articles »

Threatpost

Adwind RAT Scurries By AV Software With New DDE Variant
Threatpost
The spam campaign features two types of droppers that leverage a new variant to the already-known DDE code-injection attack on Microsoft Excel – enabling them to bypass AV software. DDE is a legitimate method for transferring data between applications ...

and more »

CMSWire

Choosing a SaaS Product: 7 Non-Software Related Considerations
CMSWire
When it comes to choosing software, you need to consider more than just the code itself. As more and more companies incorporate software-as-a-service (SaaS) tools into their marketing technology stacks, we felt it was important to address seven vital ...


GeekWire

Pixvana's new virtual reality production software lets you edit VR content while wearing a headset
GeekWire
Seattle startup Pixvana today released the full version of its software platform SPIN Studio that helps virtual reality filmmakers edit, process, and deliver video at 8K resolution. Perhaps the most notable update to SPIN is the ability to edit VR ...

and more »

ZDNet

Adwind Trojan circumvents antivirus software to infect your PC
ZDNet
"Although both the generic method and the payload are known, this campaign show[s] how some variance into well-known artifacts can trick antivirus [software]," Cisco Talos says. "Their behavior, however, is clearly classical, which means that ...


Bloomberg

India's Sliding Rupee Has an Upshot: Rising Software Exports
Bloomberg
The currency's double-digit drop against the dollar this year is helping the nation's services exports, according to HSBC Holdings Plc's chief India economist Pranjul Bhandari. So much so that the share of services exports, which mainly comprise ...

and more »

Mashable

Snag this illustrating software on sale for 50% off
Mashable
Clip Studio Paint Pro is an all-inclusive software meant to make it easier to draw and paint on your computer or tablet. Once you download the software, you'll have access to over 10,000 downloadable brushes as well as a handful of 3D models and figurines.

and more »
Google News

10 Things You Could be Using Photoshop For, But Probably Arent

Most people don't use Photoshop to its fullest capabilities. Here... Read More

Microsoft Great Plains Customization: Project Organization ? International Business Example

Microsoft Business Solutions Great Plains fits to majority of horizontal... Read More

Microsoft Great Plains Beverage Production & Distribution ? Implementation & Customization Highlight

Microsoft Business Solutions Great Plains has many years of successful... Read More

The End of Spyware?

The US House of Representatives has recently passed the "Spy... Read More

Microsoft CRM in Latin America: Implementation, Customization, Support ? Overview for Consultant

Microsoft Business Solutions CRM is present several years on the... Read More

SQL scripts for Project Accounting: Microsoft Great Plains series ? overview for developer

Microsoft Business Solutions Great Plains has Project Accounting module where... Read More

ERP Implementation: Success Factors

As seeing large number of implementations ? in our case... Read More

An Easy Way to Deal with Email Viruses and Worms

If you feel intimidated when someone tries to teach you... Read More

Open Source Concepts: Dual Licensing Explained

We were recently faced with a decision: either to let... Read More

Great Plains Dexterity History and Programming Overview

As of now - Great Plains Dynamics/eEnterprise is transformed/renamed into... Read More

Recovering Microsoft Great Plains Customization ? Tips for IT Director

Remember nice and prosperous Clinton era? When you implemented innovative... Read More

Microsoft CRM for Corporate Business ? Working Offline

If your company has regional and worldwide operations, you might... Read More

Crystal Reports for Microsoft Great Plains

Microsoft Business Solutions ? Great Plains is designed to meet... Read More

Great Plains DOS Support ? Notes for Consultant

Great Plains Accounting, accounting package for mid-size and small companies... Read More

Microsoft eCommerce Web-development: Great Plains eConnect .Net ? Highlights for Programmer

In our small article we'll consider Microsoft Business Solutions Great... Read More

Oracle Development: JDeveloper 10G ? Java, J2EE, EJB, MVC, XML - Overview For Programmer

In 2004 Oracle, Inc. made its new step toward J2EE... Read More

Microsoft CRM Custom Design & Development: SDK, C#, SQL, Exchange, Integration, Crystal Reports

Microsoft CRM is new player on the CRM software... Read More

Microsoft Office Selecting Secrets

Stop the Runaway MouseWhat's the "runaway mouse?" You've seen it...you... Read More

Are You Waiting for Microsoft Longhorn Operating System

I love new technology. I am still ready to wait... Read More

15 Questions to Ask Your Software Vendor

When making a decision to buy any piece of software... Read More

Microsoft Great Plains Jewelry ? Implementation & Customization Overview

Each Industry and market niche has business specific and unique... Read More

How To Create A Data Capture Procedure Checklist For Your Small Business CRM Software

Fortunately one of the most common reasons cited for the... Read More

Implementing ERP for Large Publicly Traded Corporation ? Microsoft Great Plains

We would like first emphasize the change in the paradigm.... Read More

Hear It in Digits

Music downloads are off the charts! We're listening to digital... Read More

DB Integration - Software for Combine MS Access Databases

Our company, Novaprof Inc., developed unique software - DB Integration.... Read More