| 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.
MORE RESOURCES: - Directory - SEO - Hosting - Software Reviews - Software News - Flash Games - software shop - sony digital camera pink digital camera - cheap book - mp3 player ipod - dummies dummies books - sony walkman - beauty shop women shop - mp3 downloads |
RELATED ARTICLES
Is Your Small Business Ready For A CRM Software Solution? I have yet to see a business that, sometimes in spite of themselves, didn't benefit from implementing a Customer Relationship Management (CRM) or a simpler Contact Management software solution.Your small business might be the rare exception, but if you can relate to some of the following scenarios, you may be ready to take advantage of the improved and inexpensive CRM systems coming on-stream. Microsoft C# vs. VB.Net Hi, Guys,I believe a lot of programmers are trying to speculate which Microsoft language is the language of the future .Net applications. QuarkXpress Tips: How to Move Content Between Print and Web Layouts Since its release in 1987, QuarkXpress had made an immediate impact to computer enthusiasts. QuarkXPress introduced precision typography, layout and color control to the desktop computer, and delivered those features to designers at a fraction of the cost of proprietary typesetting systems. Internet Relay Chat - A Basic Introduction What is IRC?IRC is Internet Relay Chat. It is a group of networked server computers that let clients (or users) connect and passes their message among the networked servers in almost real time. Microsoft CRM for Corporate Business - Working Offline If your company has regional and worldwide operations, you might already realized that it is very hard to get decent internet connection in your remote locations. In this small article we will try to give you highlights on how to implement Microsoft Business Solutions CRM for worldwide operations with restricted internet connection. Editing Your Photos Using Microsoft Picture It Publishing Platinum 2002 - A Great Dinosaur I started using PIP (Picture It Publishing) Platinum 2002 right after I got it in a bundle with my HP Pavallion N5295 Notebook more than several moons ago!I don't want to be a rocket scientist to produce edited photos quickly and with quality results, again and again.I had a terrible time at first with the edited pictures. The Secret of the Layer Styles Dialogue When you double-click a layer in the Layer Palette, you will access the Layer Style dialogue box. Here, you can set many eye-catching layer styles such as Bevel & Emboss, Drop Shadow, Inner Shadow, etc. Microsoft Great Plains: Data Conversion & Migration Scenarios - Overview for Consultant Microsoft Business Solutions Great Plains serves multiple industries in the US, plus it has strong presence in Latin America, U.K. Crystal Reports - Microsoft SQL Server Microsoft SQL Server is the leader for inexpensive and middle size SQL solutions. Plus it is now capable to serve large enterprise on Microsoft Windows platform. 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. Twelve Things You Should Know to Save on Computer Software Do you want to get quality software at a reasonable price? Whether you work at home or just need good software for your personal computer, you are faced with an almost endless selection of computer software. Sorting through the options can sometimes be a major task. Microsoft Great Plains in Metal Distribution: Implementation & Customization - Consultant Overview Microsoft Business Solutions Great Plains serves to the wide spectrum of horizontal markets and could be also considered as generic ERP/MRP/Accounting platform for light and advanced customization to fit verticals. In this small article we describe distribution sector with the example from metal distribution - Dealer/broker of industrial nonferrous by-product scrap, de-tins and de-oils industrial by-product scrap and finished parts. 5 Easy File Management Tips in Microsoft Word How many steps does it take you to locate and open your Word documents? Try these tricks to streamline how you find and open the files you use most often:Opening DocumentsWith a variety of choices, how do you open a file? Here are the standards plus several keyboard shortcuts:? File > Open? Open toolbar button (usually 2nd from the left on the Standard toolbar)? [Ctrl] + O? [Ctrl] + F12? [Ctrl] + [Alt] + F2Selecting More Than One FileOnce you are in the Open dialog box, select more than one file to open:? To select nonadjacent files in the Open dialog box, click one file, and then hold down [Ctrl] and click each additional file.? To select adjacent files in the Open dialog box, click the first file in the sequence, and then hold down [Shift] and click the last file. Microsoft Great Plains - Microsoft RMS Integration - overview Microsoft Great Plains and Microsoft Retail Management System (Microsoft RMS) are originally developed by different software vendors, who had no idea that in the remote future (now) these two applications will be owned by Microsoft and will need to be tightly integrated. Current integration between the two is not an easy thing. What is a Document Manager without Version History? Document Manager and Version HistoryIn previous articles I have discussed the usefulness of a document manager, such as groupware, in organizing document sharing. I have also discussed the role that a Version History plays in a good document manager. Microsoft Great Plains Implementation & Customization: Computer Parts Retailer Example Microsoft Great Plains fits to majority of horizontals and retail business is good fit as well. We'll consider the system, consisting from Microsoft Great Plains as Accounting, Inventory Pricing and Microsoft Retail Management System (RMS) Headquarters and Store Operations Manager. How To Avoid Getting Hooked By Pfishing "Pfishing", sometimes spelled "Phishing", is a word that's used to describe a method of identity theft where con men use fake e-mail that looks like it comes from legitimate sources. This e-mail is designed to hoodwink you into giving out personal and financial information. Great Plains Dynamics on Pervasive/Ctree support - overview for consultant All of us know that Microsoft bought former Great Plains Software and formed Microsoft (Great Plains) Business Solutions in the earlier 21st century. It was total success for GPS, we guess, but for Great Plains Dynamics / eEnterprise / Dynamics C/S+ clients it was the time of change. Lotus Notes Domino and Microsoft CRM Integration Well, even if the combination might look very unusual, we see the coexistence of these two systems, especially in large corporations, non-profit organizations. Technically Lotus Notes Domino has parallel structure, including Domino email server. C++ Function Templates C++ Function templates are those functions which can handle different data types without separate code for each of them. For a similar operation on several kinds of data types, a programmer need not write different versions by overloading a function. |
| Home | Site Map | globalwarming awareness2007 |