Software Information |
|
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/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 + " " + 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.adFailIfNotExists, 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.
|
RELATED ARTICLES
Fundraising Software ? How Can That Help Me? Fundraising software lets you connect with donors in a way that is unlike any communication you've ever had before. You can diversify your fund raising efforts with software and manage all of your day-to-day activities. There are many companies that sell fundraising software suitable for your organization. Much of the software is capable of helping you in different ways and it is available at different prices. However, you can get free software for small non-profit organizations. Microsoft Great Plains Customization Tools ? Overview Former Great Plains Software Dynamics/eEnterprise, and currently Microsoft Business Solutions Great Plains was initially designed in the earlier 1990th as the extendable and modular application with its proprietary tool: Great Plains Dexterity, written in C programming language as a shell. This was popular tendency those days ?compare with SAP ABAP or Navision C/Side. Great Plains has additional ideas ? database platform independence and graphical platform independent interface (initially targeted to both Apple Macintosh and Microsoft Windows with good chance that one of them will take market over ? and it did happen, including the acquisition of Great Plains Software by Microsoft). In this small article we'll give you revised overview ? you can find previous publication in the last year posts. Keeping Track One of the things we can be as certain of as death and taxes is that in every meeting at least one person will hand out a document for comments and discussion. But think of the huge workload this gives rise to for the author. She can only hope that not too many people respond, or that they don't all do so at once! Best Spyware Removers Finding the best spyware removers to detect and remove spyware and adware from your computer is much easier if you consider a few things before you make your purchase. Here are a few things to keep in mind when looking for a spyware protection program. Great Plains Dynamics/eEnterprise Upgrade ? Things to Consider and FAQ If you have Great Plains Dynamics/eEnterprise (version 6.0 or earlier) and support it for your company then you need to know some technical details about Great Plains version upgrade and what is going on behind the scenes, which options do you have in case of Dexterity, VBA, SQL customization, additional complexity comes with migration from ctree/Pervasive to MS SQL/MSDE. Currently you are probably thinking to upgrade to Microsoft Great Plains 8.0 or 7.5. Microsoft CRM Integration With Microsoft Office Documents ? Overview For System Integrator Microsoft CRM is CRM application, maintained and supported by Microsoft Business Solutions. Microsoft CRM utilizes majority of the Microsoft technologies: Windows Active Directory, SQL Server, MS Exchange, BizTalk (integration with MS Great Plains, and soon with Navision), Message Queuing, .Net web services to name a few. There is market demand on the efficient integration of MS Office documents into Microsoft CRM. Let's take a look at the options: Call Alert Notifications - Free Answering Machine Software for PCs If you're online using a dialup Internet connection, you'll probably want to download one of the free call alert software applications like Callwave or AOL Call Alert that can answer, record, and forward incoming calls to your home, office or cell phone. In fact, if you run a small business, Call Wave also offers a dedicated business fax service too. These software offerings are fully reviewed online at http://www.callalertreviews.com. Create ASP in Minutes DBxtra goes ASP Things You Can Do With Windows XP! Did you ever give a thought to the number of things you can do with Windows XP? Take your own time and think... I hope you remember few basic and easy things if you are not new to Windows family. Check it out the following paragraph. Preventive Maintenance Software Companies Several software companies design programs for preventive maintenance. Most of the preventive maintenance software companies produce programs for facilities and businesses. Because many programs are adaptable, they can be used for different types of facilities. Some of the best know preventive maintenance software companies are SMGlobal, Inc., Sigma Data Systems, Inc., and Smartware Group. What is Preventive Maintenance Software? Preventive Maintenance (PM) is defined as scheduled work done on a system to identify and fix any occurring issues before they become problems. The concept of preventive maintenance applies to many different industries. PM is often done on buildings, various types of machines, computers, institutions, as well as personal assets, including finances and property. Corporate ERP Selection: Microsoft Great Plains In our opinion, traditional approach when you select ERP/MRP system for large or mid-size company by functionality, database and hardware platform should be revised. We are convinced that new generation of Windows servers plus the reliability of relatively inexpensive database platform, such as Microsoft SQL Server, enable large corporation to decrease the cost of hardware, database and ERM software, plus have good internal support by hiring Microsoft certified professionals, available on the market in your area. In this small article we'll give you short review of what you should expect from Microsoft Business Solutions Great Plains, its implementation, customization, reporting, integration as well as web publishing and eCommerce or web ordering system for your existing customers. Industry Experts Answer the One Million-dollar Question - Why Genie Backup Manager? Many reasons made GBM a unanimous choice for experts, one of them is the fact that with the set of features it offers, it's definitely the easiest to use. Introduction To ISDN, Part II In the previous ISDN article, we looked at how and why one router dials another using ISDN. Just as important is knowing what keeps the link up once it is dialed. Software Process Improvement -A Successful Journey Background: For many organizations like ours, the interim target of achieving ISO 9001 or CMM levels is a daunting task. Discipline is no fun -Organizations readily acknowledge that striving to address projects according to ISO 9001 or CMM guidelines requires the creation of new procedures. It is vital to the success of improvement efforts to realize that process change entails cultural change and its human nature to resist change. Numerous social and technical barriers must be overcome to effect lasting improvement. Most Dangerous Types of Spyware are on the Rise: How to Choose the Weapon Bad News - the Threat is Bigger than it Seemed Microsoft Business Solutions VAR/Partner Selection ? Overview for IT Director/Manager/Controller Microsoft Great Plains and Microsoft CRM become more and more popular, partly because of Microsoft muscles behind them. Now Great Plains is targeted to the whole spectrum of horizontal and vertical market clientele. Small companies use Small Business Manager (which is based on the same technology ? Great Plains Dexterity dictionary and runtime), Great Plains Standard on MSDE is for small to midsize clients, and then Great Plains serves the rest of the market up to big corporations. Microsoft CRM is extremely scalable and fits to all the market niches. Microsoft Navision and Crystal Reports - An Overview Microsoft Business Solutions ? Navision is an integrated solution for small and midsize companies looking to expand their business operations without much interruption to its existing processes. Microsoft Navision enables businesses to alter as much or as little of its existing system, integrate add-ons and vertical segments of its development. It integrates every aspect of your organization, from customers to suppliers, from accounting to supply chain, increasing your productivity and competitive edge. Microsoft Navision has an open environment architecture making it fully customizable and easy to use and maintain. It can also be implemented rapidly so that there is only a minimal disruption to business operations. Why do Manufacturers Invest in Business Management Software? With many manufacturing shops heading over seas in favor of lower cost, it is tough to compete in today's marketplace. As a result, the goal for manufactures who want to compete going forward is to run leaner, faster and more accurately. Software Review: Xsitepro Total Site Management Software It's not very often I get excited about a software program, but today I'm so excited I just had to tell you about Xsitepro, the top tool for Internet marketers. In particular, those who have been using HTML applications programs like Dreamweaver and Frontpage to produce their Internet media will find this program revolutionary in that it can at least halve your time for site development. |
home | site map |
© 2005 |