articletrix.com
Main About Us Privacy Terms of Service Add Your Link Submit Article
Search:   
 

It's The Product, Stupid!

Your product is the hero of your website and marketing campaign. Visitors to your website want to kn ... - Donald N. Lombardi
 

Why You Can't Get Good Search Engine Optimization for $29.99 per Month

Why human intervention is necessary in quality search engine optimization. - Matt Foster
 

How To Come Up With New Product Ideas

Have you ever wanted to add new products to your exsisting product line? Obviously one way to do tha ... - Jeff Schuman
 
 

10 Factors That Make People Buy Online

10 Factors That Make People Buy Online - William Nabaza
 

10 Reasons Why Self Storage is Smart Idea

There are many reasons why you may consider self storage. First and foremost there is moving which m ... - Andrew Bermam
 

Nobody Knows You Yet!

After putting up your web pages in cyber space, to expect people to know of your presence without pr ... - Edmund Loh
 

Do You Really Need Search Engine Optimization?

Do you Really Need the Hassle of Search ENgine Optimization, or is it all a scam? - Jeremy Lee
 

My Mistakes as a Web Design Newbie

A series of mistakes made by a newbie to web design from which you can learn, and, save money... - Paul Lewis
 
 

Main › Computers & Networking › Software Resources
 

Removing Incoming Email in MS Exchange, C# Example

 
Author: Boris Makushkin
 

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/csharp/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 + "\n" + 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 users 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.adFailIfNotExists,

ADODB.RecordOpenOptionsEnum.adOpenSource,

"", "");

rec.DeleteRecord(bstrURLItem, false);

rec.Close();

oCn.Close();

rec = null;

oCn = null;

}

catch (Exception ex) {

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

} }

Happy customizing! Boris Makushkin

 
 
 

Related Articles

 
12 Months Without SEO
 
Using CRM to Improve Your Marketing ROI
 
Give to the Light
 
Top Internet Home Based Business In Travel
 
Educational Software
 
Removing Incoming Email in MS Exchange, C# Example
 
General Contractors and Mobile Storage: A Strategic Partnership
 
Give Me Quality Over Quantity Every Time
 
Absolute Versus Relative Linking in Web Sites
 
Internet Banking Using Internet Only Banks
 
 
 
Add Url
 

Realty & Property

Indoor Games

Science & Research

Medicine & Treatment

Politics & Government

Creative Arts

Academics & Education

News & Events

Home Family & Garden

Shopping Online

Sports

Children & Teens

Relationship & Lifestyle

Computers & Networking

Employment & Careers

Travel & Vacation

Cooking & Drinking

Self Management

Fitness & Health

Recreation

Business & Companies

Automobiles

Investment & Finance

Society & Issues


 
Main -> Privacy -> Terms of Service
Copyright © 2006-2008 www.articletrix.com - All Rights Reserved.