<?xml version="1.0" encoding="utf-8"?>
<rss xmlns:atom="https://www.w3.org/2005/Atom" xmlns:sy="https://purl.org/rss/1.0/modules/syndication/" xmlns:dc="https://purl.org/dc/elements/1.1/" xmlns:content="https://purl.org/rss/1.0/modules/content/" xmlns:wfw="https://wellformedweb.org/CommentAPI/" xmlns:slash="https://purl.org/rss/1.0/modules/slash/"
  version="2.0">
  <channel>
    <title>The Postwoman - Messaging Development</title>
    <atom:link
      href="https://docs.microsoft.com/archive/blogs/postwoman/feed.xml"
      rel="self"
      type="application/rss+xml" />
    <link>https://docs.microsoft.com/archive/blogs/postwoman/feed.xml</link>
    <description>Claudia Machado</description>
    <lastBuildDate>Wed, 17 Apr 2019 04:02:10 GMT</lastBuildDate>
    <language>en-US</language>
    <sy:updatePeriod>hourly</sy:updatePeriod>
    <sy:updateFrequency>1</sy:updateFrequency>
    <item>
      <title>EWS Editor</title>
      <link>https://docs.microsoft.com/archive/blogs/postwoman/ews-editor</link>
      <pubDate>Tue, 14 Sep 2010 08:24:18 GMT</pubDate>
      <dc:creator><![CDATA[Claudia S Machado]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.technet.microsoft.com/postwoman/2010/09/14/ews-editor/</guid>
      <description><![CDATA[EWS Editor by Matt Stehle is available...]]></description>
      <content:encoded><![CDATA[<div class="pageTitle"><span style="font-size: small;"><span style="color: #1f497d;"><span><em><b><span style="font-style: normal; font-family: 'Calibri', 'sans-serif';">EWS Editor by Matt Stehle</span></b></em><em><span style="font-style: normal; font-family: 'Calibri', 'sans-serif';"> is available at:</span></em></span></span></span></div>
<div class="mainContent">
<div class="ms-wikicontent">
<div class="ExternalClass18D123356E0A415DBC4EA239CF8199BF">
<div>
<p class="MsoNormal" style="margin: 0cm 0cm 0pt;"><em><span style="text-decoration: underline;"><span style="font-style: normal; font-family: 'Calibri', 'sans-serif'; color: #1f497d;"><a href="https://code.msdn.microsoft.com/Release/ProjectReleases.aspx?ProjectName=ewseditor&amp;ReleaseId=3767"><span style="color: #1f497d;"><span style="font-size: small;">https://code.msdn.microsoft.com/Release/ProjectReleases.aspx?ProjectName=ewseditor&amp;ReleaseId=3767</span></span></a></span></span></em></p>
<p class="MsoNormal" style="margin: 0cm 0cm 0pt;"><em><span style="font-style: normal; font-family: 'Calibri', 'sans-serif'; color: #1f497d;"><span style="font-size: small;"></span></span></em></p>
<p class="MsoNormal" style="margin: 0cm 0cm 0pt;"><em><span style="font-style: normal; font-family: 'Calibri', 'sans-serif'; color: #1f497d;"><span style="font-size: small;">The tool has 3 main goals:</span></span></em></p>
<p class="MsoListParagraphCxSpFirst" style="text-indent: -18pt; margin: 0cm 0cm 0pt 36pt;"><em><span style="font-style: normal; font-family: 'Calibri', 'sans-serif'; color: #1f497d; font-size: 11pt;"><span><span>-</span><span style="font: 7pt 'Times New Roman';">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span></span></span></em><span><em><span style="font-style: normal; font-family: 'Calibri', 'sans-serif'; color: #1f497d; font-size: 11pt;">Demonstrate the </span></em><span style="font-family: 'Calibri', 'sans-serif'; color: #1f497d; font-size: 11pt;"><a href="https://msdn.microsoft.com/en-us/library/dd633709.aspx"><span style="color: #1f497d;">Exchange Web Services Managed API</span></a><span class="MsoSubtleEmphasis"><span style="font-style: normal; color: #1f497d;"> </span></span><em><b><span style="font-style: normal; font-family: 'Calibri', 'sans-serif';">functionality and simplicity</span></b></em><em><span style="font-style: normal; font-family: 'Calibri', 'sans-serif';"> to developers through its source code.</span></em></span></span></p>
<p class="MsoListParagraphCxSpMiddle" style="text-indent: -18pt; margin: 0cm 0cm 0pt 36pt;"><em><span style="font-style: normal; font-family: 'Calibri', 'sans-serif'; color: #1f497d; font-size: 11pt;"><span><span>-</span><span style="font: 7pt 'Times New Roman';">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span></span></span></em><span><em><span style="font-style: normal; font-family: 'Calibri', 'sans-serif'; color: #1f497d; font-size: 11pt;">Show the</span></em><span class="MsoSubtleEmphasis"><span style="font-style: normal; font-family: 'Calibri', 'sans-serif'; color: #1f497d; font-size: 11pt;"> </span></span><b><span style="font-family: 'Calibri', 'sans-serif'; color: #1f497d; font-size: 11pt;"><a href="https://msdn.microsoft.com/en-us/library/bb204119(EXCHG.140).aspx"><span style="color: #1f497d;">Exchange Web Services</span></a><span class="MsoSubtleEmphasis"><span style="font-style: normal; color: #1f497d;"> </span></span><em><span style="font-style: normal; font-family: 'Calibri', 'sans-serif';">traffic</span></em></span></b><em><span style="font-style: normal; font-family: 'Calibri', 'sans-serif'; color: #1f497d; font-size: 11pt;"> used to perform actions initiated through an explorer user interface.</span></em></span></p>
<p class="MsoListParagraphCxSpLast" style="text-indent: -18pt; margin: 0cm 0cm 0pt 36pt;"><em><span style="font-style: normal; font-family: 'Calibri', 'sans-serif'; color: #1f497d; font-size: 11pt;"><span><span>-</span><span style="font: 7pt 'Times New Roman';">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span></span></span></em><em><span style="font-style: normal; font-family: 'Calibri', 'sans-serif'; color: #1f497d; font-size: 11pt;"><span>Help non-developers in debugging and understanding Exchange stores by <b>exploring items, folders, and their properties in depth</b>.</span></span></em></p>
<p class="MsoNormal" style="margin: 0cm 0cm 0pt;"><em><span style="font-style: normal; font-family: 'Calibri', 'sans-serif'; color: #1f497d;"><span style="font-size: small;"></span></span></em></p>
</div>
</div>
<p>&nbsp;</p>
</div>
</div>]]></content:encoded>
    </item>
    <item>
      <title>Diferences between CDONTS, CDOSYS, CDO, CDOEX and CDOEXM?</title>
      <link>https://docs.microsoft.com/archive/blogs/postwoman/diferences-between-cdonts-cdosys-cdo-cdoex-and-cdoexm</link>
      <pubDate>Tue, 14 Sep 2010 08:22:04 GMT</pubDate>
      <dc:creator><![CDATA[Claudia S Machado]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.technet.microsoft.com/postwoman/2010/09/14/diferences-between-cdonts-cdosys-cdo-cdoex-and-cdoexm/</guid>
      <description><![CDATA[CDONTS
Collaboration Data Objects for Microsoft Windows NT Server (CDONTS) was a COM...]]></description>
      <content:encoded><![CDATA[<div class="pageTitle"></div>
<div class="mainContent">
<div class="ms-wikicontent">
<div class="ExternalClassEE27B92AFF6546C7B6809E802FCBAFEB">
<div>
<p class="MsoNormal" style="margin: 0cm 0cm 11.25pt; vertical-align: top;"><b><span style="color: #1f497d;"><span style="font-size: small;"><span style="font-family: Calibri;">CDONTS</span></span></span></b></p>
<p class="MsoNormal" style="margin: 0cm 0cm 11.25pt; vertical-align: top;"><span style="color: #1f497d;"><span style="font-size: small;"><span style="font-family: Calibri;">Collaboration Data Objects for Microsoft Windows NT Server (CDONTS) was a COM component that was included with NT SP4 ( cdont.dll). It allowed creating and sending email messages from web application scripts, typically ASP pages. It required a local SMTP service installed to handle mail delivery. CDONTS was deprecated in Windows 2000 and removed completely in Windows 2003.</span></span></span></p>
<p class="MsoNormal" style="margin: 0cm 0cm 11.25pt; vertical-align: top;"><span style="color: #1f497d;"><span style="font-family: Calibri; font-size: small;">&nbsp;</span></span></p>
<p class="MsoNormal" style="margin: 0cm 0cm 11.25pt; vertical-align: top;"><b><span style="color: #1f497d;"><span style="font-size: small;"><span style="font-family: Calibri;">CDOSYS </span></span></span></b></p>
<p class="MsoNormal" style="margin: 0cm 0cm 11.25pt; vertical-align: top;"><span style="color: #1f497d;"><span style="font-size: small;"><span style="font-family: Calibri;">Is a library (cdosys.dll) provided as a part of IIS. CDOSYS replaced the older CDONTS.&nbsp; CDOSYS enabled applications to route smtp messages across multiple platforms.</span></span></span></p>
<p class="MsoNormal" style="margin: 0cm 0cm 11.25pt; vertical-align: top;"><span style="color: #1f497d;"><span style="font-size: small;"><span style="font-family: Calibri;">CDOSYS had more functionality over the CDONTS library, providing support for MIME messages and it could be run on the client side.</span></span></span></p>
<p class="MsoNormal" style="margin: 0cm 0cm 11.25pt; vertical-align: top;"><span style="color: #1f497d;"><span style="font-size: small;"><span style="font-family: Calibri;">CDOSYS can be used from windows 2000 to windows 2008.</span></span></span></p>
<p class="MsoNormal" style="margin: 0cm 0cm 11.25pt; vertical-align: top;"><span style="color: #1f497d;"><span style="font-family: Calibri; font-size: small;">&nbsp;</span></span></p>
<p class="MsoNormal" style="margin: 0cm 0cm 11.25pt; vertical-align: top;"><span style="color: #1f497d;"></span><b><span style="color: #1f497d;"><span style="font-size: small;"><span style="font-family: Calibri;">CDO 1.2.1</span></span></span></b></p>
<p class="MsoNormal" style="margin: 0cm 0cm 11.25pt; vertical-align: top;"><span style="color: #1f497d;"><span style="font-size: small;"><span style="font-family: Calibri;">Collaboration Data Objects (CDO) is a technology for building messaging or collaboration applications. It allows creation of applications with messaging functionality, or to add messaging functionality to existing applications.</span></span></span></p>
<p class="MsoNormal" style="margin: 0cm 0cm 11.25pt; vertical-align: top;"><span style="color: #1f497d;"><span style="font-size: small;"><span style="font-family: Calibri;">CDO is an additional scripting interface to the Messaging Application Programming Interface (MAPI) model.</span></span></span></p>
<p class="MsoNormal" style="margin: 0cm 0cm 11.25pt; vertical-align: top;"><span style="color: #1f497d;"><span style="font-size: small;"><span style="font-family: Calibri;">CDO is available through the two CDO libraries: The CDO library and the CDO rendering library. The most important one, the CDO library allows you to send and receive mail messages and to interact with folders, attachments and address books. </span></span></span></p>
<p class="MsoNormal" style="margin: 0cm 0cm 11.25pt; vertical-align: top;"><span style="color: #1f497d;"><span style="font-family: Calibri; font-size: small;">&nbsp;</span></span></p>
<p class="MsoNormal" style="margin: 0cm 0cm 11.25pt; vertical-align: top;"><b><span style="color: #1f497d;"><span style="font-size: small;"><span style="font-family: Calibri;">CDOEX</span></span></span></b></p>
<p class="MsoNormal" style="margin: 0cm 0cm 11.25pt; vertical-align: top;"><span style="color: #1f497d;"><span style="font-size: small;"><span style="font-family: Calibri;">CDO for Exchange Server (CDOEX) provides COM classes and interfaces you can use to manage information in the exchange store. You can send messages, list inbox contents and create appointments for example. You can only use it from an Exchange Server, not from a client.</span></span></span></p>
<p class="MsoNormal" style="margin: 0cm 0cm 11.25pt; vertical-align: top;"><span style="color: #1f497d;"><span style="font-size: small;"><span style="font-family: Calibri;">CDOEX is used in applications that send and process emails, calendar, contact information as well as access programmatically&nbsp; mailbox and public folders.</span></span></span></p>
<p class="MsoNormal" style="margin: 0cm 0cm 11.25pt; vertical-align: top;"><span style="color: #1f497d;"><span style="font-size: small;"><span style="font-family: Calibri;">CDOEX is de-emphasized in Exchange 2007 and not supported in Exchange 2010. You can instead use Exchange Web Services and even run it from a local or remote computer unlike CDOEX.</span></span></span></p>
<p class="MsoNormal" style="margin: 0cm 0cm 11.25pt; vertical-align: top;"><span style="color: #1f497d;"><span style="font-family: Calibri; font-size: small;">&nbsp;</span></span></p>
<p class="MsoNormal" style="margin: 0cm 0cm 11.25pt; vertical-align: top;"><b><span style="color: #1f497d;"><span style="font-size: small;"><span style="font-family: Calibri;">CDOEXM</span></span></span></b></p>
<p class="MsoNormal" style="margin: 0cm 0cm 11.25pt; vertical-align: top;"><span style="color: #1f497d;"><span style="font-size: small;"><span style="font-family: Calibri;">CDO for Exchange Management (CDOEXM) provides COM classes and interfaces to manage the Exchange store. You need to install the Exchange Administrative Tools on the computer.</span></span></span></p>
<p class="MsoNormal" style="margin: 0cm 0cm 11.25pt; vertical-align: top;"><span style="color: #1f497d;"><span style="font-size: small;"><span style="font-family: Calibri;">CDOEXM is used in administrative applications and scripts to control, examine or diagnose exchange servers and stores.</span></span></span></p>
<p class="MsoNormal" style="margin: 0cm 0cm 11.25pt; vertical-align: top;"><span style="color: #1f497d;"><span style="font-size: small;"><span style="font-family: Calibri;">CDOEXM is not supported in Exchange 2007 or 2010, you can use Powershell to perform management tasks.</span></span></span></p>
</div>
</div>
</div>
</div>]]></content:encoded>
    </item>
    <item>
      <title>How to debug an Outlook Social Provider</title>
      <link>https://docs.microsoft.com/archive/blogs/postwoman/how-to-debug-an-outlook-social-provider</link>
      <pubDate>Tue, 14 Sep 2010 08:21:17 GMT</pubDate>
      <dc:creator><![CDATA[Claudia S Machado]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.technet.microsoft.com/postwoman/2010/09/14/how-to-debug-an-outlook-social-provider/</guid>
      <description><![CDATA[The information in this weblog is provided "AS IS" with no warranties, and confers no rights. This...]]></description>
      <content:encoded><![CDATA[<div class="pageTitle"><em>The information in this weblog is provided "AS IS" with no warranties, and confers no rights. This weblog does not represent the thoughts, intentions, plans or strategies of my employer. It is solely my opinion. Inappropriate comments will be deleted at the authors discretion. All code samples are provided "AS IS" without warranty of any kind, either express or implied, including but not limited to the implied warranties of merchantability and/or fitness for a particular purpose.</em><br /></div>
<div class="pageTitle"><span style="font-family: 'Verdana', 'sans-serif'; color: black; font-size: 8pt;">To debug a provider, create a </span><span style="font-family: 'Courier New'; color: black; font-size: 10pt;">DebugProviders</span><span style="font-family: 'Verdana', 'sans-serif'; color: black; font-size: 8pt;"> value of type DWORD in the Windows registry under the </span><span style="font-family: 'Courier New'; color: black; font-size: 10pt;">SocialConnector</span><span style="font-family: 'Verdana', 'sans-serif'; color: black; font-size: 8pt;"> key (shown on the following line), and set the </span><span style="font-family: 'Courier New'; color: black; font-size: 10pt;">DebugProviders</span><span style="font-family: 'Verdana', 'sans-serif'; color: black; font-size: 8pt;"> value to 1. </span></div>
<div sizset="0" sizcache="9" class="mainContent">
<div sizset="0" sizcache="9" class="ms-wikicontent">
<div sizset="0" sizcache="9" class="ExternalClassE93C6730009547CF88A5D311E95ECE25">
<div sizset="0" sizcache="9">
<p class="MsoNormal" style="margin: 0cm 0cm 11.25pt; vertical-align: top;"><span style="font-family: 'Courier New'; color: black; font-size: 10pt;">HKEY_CURRENT_USER\Software\Microsoft\Office\Outlook\SocialConnector</span><span style="font-family: 'Verdana', 'sans-serif'; color: black; font-size: 8pt;"> </span></p>
<p class="MsoNormal" style="margin: 0cm 0cm 11.25pt; vertical-align: top;"><span style="font-family: 'Verdana', 'sans-serif'; color: black; font-size: 8pt;">By default, provider debugging is not turned on. If the </span><span style="font-family: 'Courier New'; color: black; font-size: 10pt;">DebugProviders</span><span style="font-family: 'Verdana', 'sans-serif'; color: black; font-size: 8pt;"> value is not present, or it is present and set to a value of 0, provider debugging is turned off. </span></p>
<p class="MsoNormal" style="margin: 0cm 0cm 11.25pt; vertical-align: top;"><span style="font-family: 'Verdana', 'sans-serif'; color: black; font-size: 8pt;">If the </span><span style="font-family: 'Courier New'; color: black; font-size: 10pt;">DebugProviders</span><span style="font-family: 'Verdana', 'sans-serif'; color: black; font-size: 8pt;"> value is set to 1, an alert dialog box is displayed with verbose error information when an error occurs. Setting the </span><span style="font-family: 'Courier New'; color: black; font-size: 10pt;">DebugProviders</span><span style="font-family: 'Verdana', 'sans-serif'; color: black; font-size: 8pt;"> value to 1 also causes validation of provider XML against the schema for OSC provider extensibility, OutlookSocialProvider.xsd. The effect of this registration key is global&mdash;the debug alert appears for all loaded providers instead of for a specific provider.</span></p>
<p class="MsoNormal" style="margin: 0cm 0cm 11.25pt; vertical-align: top;"><span style="font-family: 'Verdana', 'sans-serif'; color: black; font-size: 8pt;">To display command bar buttons that can help you debug a provider, create a </span><span style="font-family: 'Courier New'; color: black; font-size: 10pt;">ShowDebugButtons</span><span style="font-family: 'Verdana', 'sans-serif'; color: black; font-size: 8pt;"> value of type DWORD in the Windows registry under the </span><span style="font-family: 'Courier New'; color: black; font-size: 10pt;">SocialConnector</span><span style="font-family: 'Verdana', 'sans-serif'; color: black; font-size: 8pt;"> key, and set the </span><span style="font-family: 'Courier New'; color: black; font-size: 10pt;">ShowDebugButtons</span><span style="font-family: 'Verdana', 'sans-serif'; color: black; font-size: 8pt;"> value to 1. To hide the debug command bar buttons, set the </span><span style="font-family: 'Courier New'; color: black; font-size: 10pt;">ShowDebugButtons</span><span style="font-family: 'Verdana', 'sans-serif'; color: black; font-size: 8pt;"> value to 0. </span></p>
<p class="MsoNormal" style="margin: 0cm 0cm 11.25pt; vertical-align: top;"><span style="font-family: 'Verdana', 'sans-serif'; color: black; font-size: 8pt;">For Outlook 2010, the debug command bar buttons appear on the <b>Add-ins</b> tab of the explorer ribbon. For Outlook 2007 and Outlook 2003, the debug command bar buttons appear on the standard command bar of the Outlook explorer window.</span></p>
<p class="MsoNormal" style="margin: 0cm 0cm 11.25pt; vertical-align: top;"><span style="font-family: 'Verdana', 'sans-serif'; color: black; font-size: 8pt;">The following table shows the provider debug commands.</span></p>
<table cellpadding="0" border="1" class="MsoNormalTable" style="margin: auto auto auto 3.75pt; width: 97%; border: #dddddd 1pt solid;">
<tbody>
<tr>
<td valign="bottom" style="border-bottom: #c8cdde 1pt solid; border-left: #cccccc 1pt solid; background: #cccccc; border-top: #cccccc 1pt solid; border-right: #cccccc 1pt solid; padding: 3.75pt;">
<p class="MsoNormal" style="margin: 3.75pt 0cm;"><b><span style="font-family: 'Verdana', 'sans-serif'; color: #000066; font-size: 8pt;">Command </span></b></p>
</td>
<td valign="bottom" style="border-bottom: #c8cdde 1pt solid; border-left: #cccccc 1pt solid; background: #cccccc; border-top: #cccccc 1pt solid; border-right: #cccccc 1pt solid; padding: 3.75pt;">
<p class="MsoNormal" style="margin: 3.75pt 0cm;"><b><span style="font-family: 'Verdana', 'sans-serif'; color: #000066; font-size: 8pt;">Function </span></b></p>
</td>
</tr>
<tr>
<td valign="top" style="border-bottom: #cccccc 1pt solid; border-left: #cccccc 1pt solid; background: white; border-top: #cccccc 1pt solid; border-right: #d5d5d3 1pt solid; padding: 3.75pt;">
<p class="MsoNormal" style="margin: 0cm 0.75pt 0pt;"><b><span style="font-family: 'Verdana', 'sans-serif'; color: black; font-size: 8pt;">Sync Feeds</span></b><span style="font-family: 'Verdana', 'sans-serif'; color: black; font-size: 8pt;"> </span></p>
</td>
<td valign="top" style="border-bottom: #cccccc 1pt solid; border-left: #cccccc 1pt solid; background: white; border-top: #cccccc 1pt solid; border-right: #d5d5d3 1pt solid; padding: 3.75pt;">
<p class="MsoNormal" style="margin: 0cm 0.75pt 0pt;"><span style="font-family: 'Verdana', 'sans-serif'; color: black; font-size: 8pt;">Causes the OSC to ask the provider for cached activities only.</span></p>
</td>
</tr>
<tr>
<td valign="top" style="border-bottom: #cccccc 1pt solid; border-left: #cccccc 1pt solid; background: white; border-top: #cccccc 1pt solid; border-right: #d5d5d3 1pt solid; padding: 3.75pt;">
<p class="MsoNormal" style="margin: 0cm 0.75pt 0pt;"><b><span style="font-family: 'Verdana', 'sans-serif'; color: black; font-size: 8pt;">Sync Contacts</span></b><span style="font-family: 'Verdana', 'sans-serif'; color: black; font-size: 8pt;"> </span></p>
</td>
<td valign="top" style="border-bottom: #cccccc 1pt solid; border-left: #cccccc 1pt solid; background: white; border-top: #cccccc 1pt solid; border-right: #d5d5d3 1pt solid; padding: 3.75pt;">
<p class="MsoNormal" style="margin: 0cm 0.75pt 0pt;"><span style="font-family: 'Verdana', 'sans-serif'; color: black; font-size: 8pt;">Causes the OSC to ask the provider for cached contacts only.</span></p>
</td>
</tr>
<tr>
<td valign="top" style="border-bottom: #cccccc 1pt solid; border-left: #cccccc 1pt solid; background: white; border-top: #cccccc 1pt solid; border-right: #d5d5d3 1pt solid; padding: 3.75pt;">
<p class="MsoNormal" style="margin: 0cm 0.75pt 0pt;"><b><span style="font-family: 'Verdana', 'sans-serif'; color: black; font-size: 8pt;">GAL Sync</span></b><span style="font-family: 'Verdana', 'sans-serif'; color: black; font-size: 8pt;"> </span></p>
</td>
<td valign="top" style="border-bottom: #cccccc 1pt solid; border-left: #cccccc 1pt solid; background: white; border-top: #cccccc 1pt solid; border-right: #d5d5d3 1pt solid; padding: 3.75pt;">
<p class="MsoNormal" style="margin: 0cm 0.75pt 0pt;"><span style="font-family: 'Verdana', 'sans-serif'; color: black; font-size: 8pt;">Causes the OSC to populate data from the Microsoft Exchange Global Address List to Outlook contacts.</span></p>
</td>
</tr>
<tr>
<td valign="top" style="border-bottom: #cccccc 1pt solid; border-left: #cccccc 1pt solid; background: white; border-top: #cccccc 1pt solid; border-right: #d5d5d3 1pt solid; padding: 3.75pt;">
<p class="MsoNormal" style="margin: 0cm 0.75pt 0pt;"><b><span style="font-family: 'Verdana', 'sans-serif'; color: black; font-size: 8pt;">Clear AFI Cache</span></b><span style="font-family: 'Verdana', 'sans-serif'; color: black; font-size: 8pt;"> </span></p>
</td>
<td valign="top" style="border-bottom: #cccccc 1pt solid; border-left: #cccccc 1pt solid; background: white; border-top: #cccccc 1pt solid; border-right: #d5d5d3 1pt solid; padding: 3.75pt;">
<p class="MsoNormal" style="margin: 0cm 0.75pt 0pt;"><span style="font-family: 'Verdana', 'sans-serif'; color: black; font-size: 8pt;">Clears the in-memory activity cache.</span></p>
</td>
</tr>
<tr>
<td valign="top" style="border-bottom: #cccccc 1pt solid; border-left: #cccccc 1pt solid; background: white; border-top: #cccccc 1pt solid; border-right: #d5d5d3 1pt solid; padding: 3.75pt;">
<p class="MsoNormal" style="margin: 0cm 0.75pt 0pt;"><b><span style="font-family: 'Verdana', 'sans-serif'; color: black; font-size: 8pt;">Clear Contact Cache</span></b><span style="font-family: 'Verdana', 'sans-serif'; color: black; font-size: 8pt;"> </span></p>
</td>
<td valign="top" style="border-bottom: #cccccc 1pt solid; border-left: #cccccc 1pt solid; background: white; border-top: #cccccc 1pt solid; border-right: #d5d5d3 1pt solid; padding: 3.75pt;">
<p class="MsoNormal" style="margin: 0cm 0.75pt 0pt;"><span style="font-family: 'Verdana', 'sans-serif'; color: black; font-size: 8pt;">Clears the in-memory contact cache.</span></p>
</td>
</tr>
<tr>
<td valign="top" style="border-bottom: #cccccc 1pt solid; border-left: #cccccc 1pt solid; background: white; border-top: #cccccc 1pt solid; border-right: #d5d5d3 1pt solid; padding: 3.75pt;">
<p class="MsoNormal" style="margin: 0cm 0.75pt 0pt;"><b><span style="font-family: 'Verdana', 'sans-serif'; color: black; font-size: 8pt;">Invalidate Category Cache</span></b><span style="font-family: 'Verdana', 'sans-serif'; color: black; font-size: 8pt;"> </span></p>
</td>
<td valign="top" style="border-bottom: #cccccc 1pt solid; border-left: #cccccc 1pt solid; background: white; border-top: #cccccc 1pt solid; border-right: #d5d5d3 1pt solid; padding: 3.75pt;">
<p class="MsoNormal" style="margin: 0cm 0.75pt 0pt;"><span style="font-family: 'Verdana', 'sans-serif'; color: black; font-size: 8pt;">Causes the OSC to reload the category list for each store when the activity feed is refreshed.</span></p>
</td>
</tr>
</tbody>
</table>
</div>
</div>
</div>
</div>]]></content:encoded>
    </item>
    <item>
      <title>Step-by-step - How to create an Outlook 2007 addin with a form region</title>
      <link>https://docs.microsoft.com/archive/blogs/postwoman/step-by-step-how-to-create-an-outlook-2007-addin-with-a-form-region</link>
      <pubDate>Tue, 14 Sep 2010 08:19:20 GMT</pubDate>
      <dc:creator><![CDATA[Claudia S Machado]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.technet.microsoft.com/postwoman/2010/09/14/step-by-step-how-to-create-an-outlook-2007-addin-with-a-form-region/</guid>
      <description><![CDATA[The information in this weblog is provided "AS IS" with no warranties, and confers no rights. This...]]></description>
      <content:encoded><![CDATA[<div class="pageTitle"><em>The information in this weblog is provided "AS IS" with no warranties, and confers no rights. This weblog does not represent the thoughts, intentions, plans or strategies of my employer. It is solely my opinion. Inappropriate comments will be deleted at the authors discretion. All code samples are provided "AS IS" without warranty of any kind, either express or implied, including but not limited to the implied warranties of merchantability and/or fitness for a particular purpose.<br /></em></div>
<div class="pageTitle"></div>
<div class="pageTitle">When using Visual Studio 2008, creating an Outlook 2007 addin&nbsp;is very simple. There are wizards available that takes care of most tasks so it is possible to get very far without writing a single line of code. In this walk-through I will show how to create an add-in that shows a form region shows the e-mail headers of a message. The form region will only be visible for normal messages (messages of type IPM.Note). The below screen shot shows how the form region looks like at the bottom of an e-mail message.</div>
<div class="mainContent">
<div class="ms-wikicontent">
<div class="ExternalClass10EA4A2F4D4E41CD8D23E404BBF37DC6">&nbsp;</div>
<div class="ExternalClass10EA4A2F4D4E41CD8D23E404BBF37DC6">&nbsp;</div>
<div class="ExternalClass10EA4A2F4D4E41CD8D23E404BBF37DC6"><ol>
<li>Click File | New | Project... in Visual Studio to create&nbsp;a new project. Under Visual C#, expand Office, click 2007 and in the right pane click Outlook 2007 Add-in. Name the project HeaderAddin and choose the directory where the wizard will create the add-in. </li>
<li><br />Right click the project name in the solution explorer window and click properties. Click Assembly information and change the language to English UK. Click OK until you see the main project window.</li>
<li>Right click the project name in the solution explorer window and click add | new item... Under Visual C# Items choose Outlook Form Region. Name the file headerregion and click the add button. This will start the New Outlook Form Region Wizard.<br /></li>
<li>Make sure Design a new form region is chosen and click next. <br /></li>
<li>On the next wizard page choose <strong>Adjoining</strong> and click next.</li>
<li>Name the new form region HeaderRegion. Uncheck <strong>Inspectors that are in compose mode </strong>to prevent the form region from being displayed when the user writes a new message or replies to existing messages. Leave the other two options checked.<br /></li>
<li>Choose <strong>Mail Message (IPM.Note)</strong> and leave all the other options unchecked and press Finish.<br /></li>
<li>headerregion.cs should now be shown in design mode. If it is not, double click headerregion.cs in the solution explorer to <br />bring the new form region up. Resize the form region until an appropriate size. 600x150 will work well. Click View | toolbox and drag a textbox control on to the form region. Resize the textbox to the same size as the form region.</li>
<li>Change the textbox style to multiline and make it readonly.<br /></li>
<li>Right click HeaderRegion.cs and choose view code. Scroll down to the method called HeaderRegion_FormRegionShowing and add the following code<br /><br /><span style="font-family: Courier New; font-size: x-small;"><span style="color: #0000ff;">private void </span>HeaderRegion_FormRegionShowing(<span style="color: #0000ff;">object</span> sender, System.<span style="color: #008080;">EventArgs</span> e)<br />{<br /><span style="color: #008000;">&nbsp;&nbsp;&nbsp; // query for PR_TRANSPORT_MESSAGE_HEADERS here and display it in the form region.</span><br />&nbsp;&nbsp;&nbsp;&nbsp;Outlook.<span style="color: #008080;">MailItem</span> item = (Outlook.<span style="color: #008080;">MailItem</span>)<span style="color: #0000ff;">this</span>.OutlookItem;<br />&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #008080;">String</span> prop = <span style="color: #993300;">"</span></span><a href="https://schemas.test.com/mapi/proptag/0x007D001E"><span style="font-family: Courier New; color: #993300; font-size: x-small;">https://schemas.test.com/mapi/proptag/0x007D001E</span></a><span style="font-family: Courier New; font-size: x-small;"><span style="color: #993300;">"</span>;<br />&nbsp;&nbsp;&nbsp;&nbsp;Outlook.<span style="color: #008080;">PropertyAccessor</span> oPa = item.PropertyAccessor;<br />&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #008080;">String</span> strHeaders = (<span style="color: #008080;">String</span>) oPa.GetProperty(prop);&nbsp; <br />&nbsp;&nbsp;&nbsp; textBox1.Text = strHeaders;<br />}</span><br /></li>
<li>Press CTRL+SHIFT+B to compile.&nbsp;As long as Outlook is installed on the same machine as Visual Studio, you can press CTRL+F5 to start Outlook with the form region loaded.</li>
</ol></div>
</div>
</div>]]></content:encoded>
    </item>
    <item>
      <title>Step-by-step - How to create a routing agent</title>
      <link>https://docs.microsoft.com/archive/blogs/postwoman/step-by-step-how-to-create-a-routing-agent</link>
      <pubDate>Tue, 14 Sep 2010 08:16:07 GMT</pubDate>
      <dc:creator><![CDATA[Claudia S Machado]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.technet.microsoft.com/postwoman/2010/09/14/step-by-step-how-to-create-a-routing-agent/</guid>
      <description><![CDATA[The information in this weblog is provided "AS IS" with no warranties, and confers no rights. This...]]></description>
      <content:encoded><![CDATA[<p><span style="font-family: Arial; font-size: x-small;"><em>The information in this weblog is provided "AS IS" with no warranties, and confers no rights. This weblog does not represent the thoughts, intentions, plans or strategies of my employer. It is solely my opinion. Inappropriate comments will be deleted at the authors discretion. All code samples are provided "AS IS" without warranty of any kind, either express or implied, including but not limited to the implied warranties of merchantability and/or fitness for a particular purpose.</em></span></p>
<p>This step-by-step procedure will show how you can create a new routing agent that adds an image disclaimer to the bottom of every outgoing html e-mail. <br />The sample will also show how you install,enable and test the agent. <br />&nbsp;<br />Software needed:<br />Exchange 2007 SP1 or newer<br />Visual Studio 2008 SP1 or newer<br />&nbsp;<br />If Visual Studio is installed on a different machine than Exchange server, copy microsoft.exchange.data.common.dll and microsoft.exchange.data.transport.dll from C:\Program Files\Microsoft\Exchange Server\Public to a folder on the Visual Studio machine. </p>
<p>Create a new Visual C# project using the "Class Library" template.</p>
<p>In the Solution Explorer window, right click References and choose Add Reference...<br />Click the Browse tab and find microsoft.exchange.data.common.dll and microsoft.exchange.data.transport.dll. Mark both files and click OK to add the reference.</p>
<p>The default file will look something like this</p>
<p>using System;<br />using System.Collections.Generic;<br />using System.Linq;<br />using System.Text;</p>
<p>namespace AgentX<br />{<br />&nbsp;&nbsp;&nbsp; public class AgentClass<br />&nbsp;&nbsp;&nbsp; {<br />&nbsp;&nbsp;&nbsp; }<br />}</p>
<p><br />Add additional using statements to make datatypes from the newly referenced Exchange assemblies visible.</p>
<p>using System.Text;<br />using Microsoft.Exchange.Data.Transport;<br />using Microsoft.Exchange.Data.Transport.Email;<br />using Microsoft.Exchange.Data.Transport.Routing;</p>
<p><br />Modify the existing class so it inherits from the RoutingAgent class and add a second class called AgentFactory that inherits from RoutingAgentFactory.</p>
<p>namespace AgentX<br />{<br />&nbsp;&nbsp;&nbsp; public sealed class AgentFactory : RoutingAgentFactory<br />&nbsp;&nbsp;&nbsp; {<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; public override RoutingAgent CreateAgent(SmtpServer server)<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; return new AgentClass();<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }<br />&nbsp;&nbsp;&nbsp; }</p>
<p>&nbsp;&nbsp;&nbsp; public class AgentClass : RoutingAgent<br />&nbsp;&nbsp;&nbsp; {<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; public AgentClass()<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }<br />&nbsp;&nbsp;&nbsp; }<br />}</p>
<p><br />A routing agent can handle 4 different events. Which event to handle depends on the business logic that the agent will implement. Here's the 4 different events and the order in which they occur.</p>
<p>OnSubmittedMessage - After message has entered the submit queue<br />OnResolvedMessage - After resolving the recipients but before determining the route.<br />OnRoutedMessage - After determining the route but before content conversion.<br />OnCategorizedMessage - After Content Conversion.</p>
<p>In this agent I choose the implement the OnRoutedMessage event. </p>
<p><br />Inside the AgentClass constructor, add the line</p>
<p>base.OnRoutedMessage += new RoutedMessageHandlerEventHandler(AgentClass_OnRoutedMessage);</p>
<p>Visual Studio will automatically offer to add the OnRoutedMessage event handler method for you. It should look like this</p>
<p>void AgentClass_OnRoutedMessage(RoutedMessageEventSource source, QueuedMessageEventArgs e)<br />{<br />}</p>
<p>If you are creating a different agent, add your business logic and skip down to step 12 for information about how to register and test the agent. The next step will add the logic that adds an image to every outgoing e-mail.</p>
<p><br />We need to add a using statements for System.IO, System.Diagnostics, Microsoft.Exchange.Data.Mime and Microsoft.Exchange.Data.ContentTypes.Tnef. The complete list of using statements should look like this</p>
<p>using System;<br />using System.Collections.Generic;<br />using System.Linq;<br />using System.Text;<br />using System.IO;<br />using Microsoft.Exchange.Data.Transport.Email;<br />using Microsoft.Exchange.Data.Transport.Routing;<br />using Microsoft.Exchange.Data.Transport;<br />using Microsoft.Exchange.Data.Mime;<br />using Microsoft.Exchange.Data.ContentTypes.Tnef;</p>
<p><br />Next, add 2 global variables to the AgentClass. ContentID will store filename as it occurs in the html content of the e-mail and el is a variable that we use to write event log entries.</p>
<p>In the AgentClass constructor add code to initialize the event log sourceand in the event handler for OnRoutedMessage, make a method call to GetContentID to create a new random filename followed by a call to attachSignatureImage that will insert the image into the message. </p>
<p>Below is the complete code so far</p>
<p>public class AgentClass : RoutingAgent<br />{<br />&nbsp;&nbsp;&nbsp; String ContentID;<br />&nbsp;&nbsp;&nbsp; EventLog el;</p>
<p>&nbsp;&nbsp;&nbsp; public AgentClass()<br />&nbsp;&nbsp;&nbsp; {<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ContentID = "";<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; base.OnRoutedMessage += new RoutedMessageEventHandler(AgentClass_OnRoutedMessage);&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <br />&nbsp;&nbsp;&nbsp; }</p>
<p>&nbsp;&nbsp;&nbsp; void AgentClass_OnRoutedMessage(RoutedMessageEventSource source, QueuedMessageEventArgs e)<br />&nbsp;&nbsp;&nbsp; {<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ContentID = GetContentID();<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; attachSignatureImage("c:\\agentx", "file1.jpg", e.MailItem.Message);<br />&nbsp;&nbsp;&nbsp; }</p>
<p><br />Add the 3 methods GetContentID, attachSignatureImage and <br />AttachmentFromTNEF as shown below. These 3 methods are all members of the AgentClass.</p>
<p>private String GetContentID()<br />{<br />&nbsp;&nbsp;&nbsp; Random r = new Random();<br />&nbsp;&nbsp;&nbsp; int num = r.Next(0, 1000000000);&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <br />&nbsp;&nbsp;&nbsp; return "file1.jpg@" + num.ToString();<br />}</p>
<p>private bool attachSignatureImage(String path, String showAsFilename, EmailMessage emailMessage)<br />{<br />&nbsp;&nbsp;&nbsp; try<br />&nbsp;&nbsp;&nbsp; {<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; // Include attachment only, if HTML Format<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Body body = emailMessage.Body;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if (body.BodyFormat == BodyFormat.Html)<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Stream origBody;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Stream newBody;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if (!body.TryGetContentReadStream(out origBody))<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; throw new InvalidDataException("Could not read html body.");</p>
<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Byte[] mailbodyarray = new Byte[origBody.Length];<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; origBody.Read(mailbodyarray, 0, (int)origBody.Length);<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; origBody.Close();</p>
<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Byte[] newbodyarray = new Byte[mailbodyarray.Length + ContentID.Length + 16];<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; // insert &lt;img src=cid:file1.jpg@1234&gt; just before the &lt;/body&gt; tag<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ASCIIEncoding enc = new ASCIIEncoding();&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; String str = enc.GetString(mailbodyarray);<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; int i = str.LastIndexOf("&lt;/body&gt;");<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; str = str.Insert(i, "&lt;img src=cid:" + ContentID + "&gt;\r\n");<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; newbodyarray = enc.GetBytes(str);<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; newBody = body.GetContentWriteStream();&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; newBody.Write(newbodyarray, 0, newbodyarray.Length);&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; newBody.Flush();<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; newBody.Close();</p>
<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if (File.Exists(path + "\\" + showAsFilename))<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Byte[] logo_binary = File.ReadAllBytes(path + "\\" + showAsFilename);<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if (logo_binary.Length &gt; 0)<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Attachment logo = emailMessage.Attachments.Add(showAsFilename, "image/jpeg");<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Stream logo_stream = logo.GetContentWriteStream();<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; logo_stream.Write(logo_binary, 0, logo_binary.Length);<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; logo_stream.Flush();<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; logo_stream.Close();</p>
<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; // If MIME TYPE is used, then add header in Mime format<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if (logo.MimePart != null)<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Header dis = logo.MimePart.Headers.FindFirst(HeaderId.ContentDisposition);<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; dis.Value = "inline";</p>
<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Header hContentId = Header.Create(HeaderId.ContentId);<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; hContentId.Value = "&lt;" + ContentID + "&gt;";<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; logo.MimePart.Headers.AppendChild(hContentId);<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; //&nbsp; If TnefPart (if sent from Outlook 2003/2007), add headers within a Tnef routine<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; else if (emailMessage.TnefPart != null)<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; AttachmentFromTNEF(ref emailMessage);<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; return true;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; else<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; // unable to open image file.<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }<br />&nbsp;&nbsp;&nbsp; }<br />&nbsp;&nbsp;&nbsp; catch (InvalidOperationException ioex)<br />&nbsp;&nbsp;&nbsp; {&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <br />&nbsp;&nbsp;&nbsp; }<br />&nbsp;&nbsp;&nbsp; return false;<br />}</p>
<p><br />private void AttachmentFromTNEF(ref EmailMessage emailMessage)<br />{<br />&nbsp;&nbsp;&nbsp; TnefReader reader = new TnefReader(emailMessage.TnefPart.GetContentReadStream(), 0, TnefComplianceMode.Loose);<br />&nbsp;&nbsp;&nbsp; short key = reader.AttachmentKey;<br />&nbsp;&nbsp;&nbsp; TnefWriter writer = new TnefWriter(emailMessage.TnefPart.GetContentWriteStream("Binary"), key);<br />&nbsp;&nbsp;&nbsp; int attachmentCount = 0;<br />&nbsp;&nbsp;&nbsp; int foundFile = 0;<br />&nbsp;&nbsp;&nbsp; try<br />&nbsp;&nbsp;&nbsp; {&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; while (reader.ReadNextAttribute())<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if (reader.AttributeLevel == TnefAttributeLevel.Attachment)<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if (reader.AttributeTag == TnefAttributeTag.AttachRenderData)<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; attachmentCount++;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; switch (reader.AttributeTag)<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; case TnefAttributeTag.AttachTitle:<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; writer.StartAttribute(reader.AttributeTag, reader.AttributeLevel);<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if (attachmentCount &gt; 0)<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; while (reader.PropertyReader.ReadNextProperty())<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbs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;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; // contentID will be <a href="mailto:file1.jpg@123456789">file1.jpg@123456789</a> while pr is file1.jpg<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; // if ContentID contains pr, set foundfile.<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if (ContentID.Contains(pr))<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; foundFile = attachmentCount;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&n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nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; break;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; case TnefAttributeTag.Attachment:<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if (foundFile == attachmentCount &amp;&amp; attachmentCount &gt; 0)<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; writer.StartAttribute(reader.AttributeTag, reader.AttributeLevel);<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; writer.WriteAllProperties(reader.PropertyReader);&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbs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&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; writer.StartProperty(new TnefPropertyTag(attachhidden));<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; writer.WritePropertyValue(true);</p>
<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; writer.StartProperty(new TnefPropertyTag(flags));<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; writer.WritePropertyValue(4);&nbsp; // ATT_MHTML_REF<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nb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&nbsp;&nbsp; writer.WriteAttribute(reader);<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; break;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; else<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; // it's a message level attribute<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if (reader.AttributeTag == TnefAttributeTag.MapiProperties)<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; writer.StartAttribute(TnefAttributeTag.MapiProperties, TnefAttributeLevel.Message);<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;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x8514000B;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; tag2 = (int)0x00008514;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Guid PSETID_Common = new Guid("00062008-0000-0000-C000-000000000046");&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; writer.StartProperty(new TnefPropertyTag(tag), PSETID_Common, tag2);&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; writer.WritePropertyValue(true);<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; else<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; writer.WriteAttribute(reader);<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <br />&nbsp;&nbsp;&nbsp; }<br />&nbsp;&nbsp;&nbsp; catch (Exception x)<br />&nbsp;&nbsp;&nbsp; {<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; // exception<br />&nbsp;&nbsp;&nbsp; }<br />&nbsp;&nbsp;&nbsp; finally<br />&nbsp;&nbsp;&nbsp; {<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; writer.Close();<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; reader.Close();<br />&nbsp;&nbsp;&nbsp; }<br />}</p>
<p>The code above will load the image from a file on disk and insert it into the Tnef part of the message. It will then add 3 properties. <br />PidLidSmartNoAttach (<a href="https://msdn.microsoft.com/en-us/library/cc839557.aspx">https://msdn.microsoft.com/en-us/library/cc839557.aspx</a>), <br />PidTagAttachmentHidden (PR_ATTACHMENT_HIDDEN) (<a href="https://msdn.microsoft.com/en-us/library/cc839828.aspx">https://msdn.microsoft.com/en-us/library/cc839828.aspx</a>) and <br />PidTagAttachFlags (PR_ATTACH_FLAGS) (<a href="https://msdn.microsoft.com/en-us/library/cc765876.aspx">https://msdn.microsoft.com/en-us/library/cc765876.aspx</a>).</p>
<p><br />To install the Transport Agent, copy it to the Exchange server and run the following Powershell command. </p>
<p>Install-TransportAgent -Name AgentX -TransportAgentFactory "AgentX.AgentFactory" -AssemblyPath "C:\projects\MyAgent\MyAgent\Debug\MyAgent.dll" </p>
<p>This will register the agent with SMTP but will not enable it. To enable the agent, run the command</p>
<p>Enable-TransportAgent -Name "AgentX" </p>
<p>Also make sure that the image file is located in the folder hardcoded in the source code (see step 10).</p>
<p><br />Now that the agent is installed and enabled, we can go ahead and test the agent. <br />Run OWA and send a short message to another user. The image file should have been inserted as an inline attachment at the bottom of the message. <br />If the message is received without an attachment, have a look in the Application event log for an event containing more information about the problem.</p>]]></content:encoded>
    </item>
    <item>
      <title>“554 5.5.2 Invalid data in message&gt; #SMTP#”  non delivery report in E2K7</title>
      <link>https://docs.microsoft.com/archive/blogs/postwoman/554-5-5-2-invalid-data-in-message-smtp-non-delivery-report-in-e2k7</link>
      <pubDate>Tue, 04 Aug 2009 19:39:00 GMT</pubDate>
      <dc:creator><![CDATA[Claudia S Machado]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.technet.microsoft.com/postwoman/2009/08/04/554-5-5-2-invalid-data-in-message-smtp-non-delivery-report-in-e2k7/</guid>
      <description><![CDATA[If you get a “554 5.5.2 Invalid data in message&gt; #SMTP#” non delivery report while sending...]]></description>
      <content:encoded><![CDATA[<SPAN style="FONT-FAMILY: 'Verdana','sans-serif'; COLOR: #1f497d; mso-ansi-language: EN-US" lang=EN-US><?xml:namespace prefix = o /><o:p><FONT color=#000000><SPAN style="FONT-FAMILY: 'Verdana','sans-serif'; FONT-SIZE: 10pt; mso-ansi-language: EN-US; mso-fareast-font-family: 'Times New Roman'; mso-bidi-font-family: Arial; mso-fareast-language: EN-GB" lang=EN-US>
<P style="MARGIN: 0cm 0cm 0pt" class=MsoNormal><SPAN style="FONT-FAMILY: 'Verdana','sans-serif'; COLOR: white; FONT-SIZE: 10pt; mso-ansi-language: EN-US; mso-fareast-font-family: 'Times New Roman'; mso-bidi-font-family: Arial; mso-fareast-language: EN-GB; mso-themecolor: background1" lang=EN-US>If you get a “554 5.5.2 Invalid data in message&gt; #SMTP#” non delivery report while sending emails with attachments between different domains (E2K7\E2K3)</SPAN><SPAN style="FONT-FAMILY: 'Arial','sans-serif'; COLOR: white; FONT-SIZE: 10pt; mso-fareast-font-family: 'Times New Roman'; mso-fareast-language: EN-GB; mso-themecolor: background1"><?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" /><o:p></o:p></SPAN></P>
<P style="MARGIN: 0cm 0cm 0pt" class=MsoNormal><SPAN style="FONT-FAMILY: 'Verdana','sans-serif'; COLOR: white; FONT-SIZE: 10pt; mso-ansi-language: EN-US; mso-fareast-font-family: 'Times New Roman'; mso-bidi-font-family: Arial; mso-fareast-language: EN-GB; mso-themecolor: background1" lang=EN-US>Check your Firewall, some have a header size restriction that blocks messages from being sent or where Content-Type has a maximum field of 200 bytes. </SPAN><SPAN style="FONT-FAMILY: 'Arial','sans-serif'; COLOR: white; FONT-SIZE: 10pt; mso-fareast-font-family: 'Times New Roman'; mso-fareast-language: EN-GB; mso-themecolor: background1"><o:p></o:p></SPAN></P>
<P style="MARGIN: 0cm 0cm 0pt" class=MsoNormal><SPAN style="FONT-FAMILY: 'Verdana','sans-serif'; COLOR: white; FONT-SIZE: 10pt; mso-ansi-language: EN-US; mso-fareast-font-family: 'Times New Roman'; mso-bidi-font-family: Arial; mso-fareast-language: EN-GB; mso-themecolor: background1" lang=EN-US>E-mails that exceed this restriction will be denied with the error you are receiving. E2k7 adds additional fields to the header (i.e. date information, header length) that E2k3 doesn't add.</SPAN><SPAN style="FONT-FAMILY: 'Arial','sans-serif'; COLOR: white; FONT-SIZE: 10pt; mso-fareast-font-family: 'Times New Roman'; mso-fareast-language: EN-GB; mso-themecolor: background1"><o:p></o:p></SPAN></P>
<P style="MARGIN: 0cm 0cm 0pt" class=MsoNormal><SPAN style="FONT-FAMILY: 'Verdana','sans-serif'; COLOR: white; FONT-SIZE: 10pt; mso-ansi-language: EN-US; mso-fareast-font-family: 'Times New Roman'; mso-bidi-font-family: Arial; mso-fareast-language: EN-GB; mso-themecolor: background1" lang=EN-US>The solution is to change the settings of the firewall by adding these entries bellow to change the length of the headers allowed:</SPAN><SPAN style="FONT-FAMILY: 'Arial','sans-serif'; COLOR: white; FONT-SIZE: 10pt; mso-fareast-font-family: 'Times New Roman'; mso-fareast-language: EN-GB; mso-themecolor: background1"><o:p></o:p></SPAN></P>
<P style="MARGIN: 0cm 0cm 0pt" class=MsoNormal><SPAN style="FONT-FAMILY: 'Verdana','sans-serif'; COLOR: white; FONT-SIZE: 10pt; mso-ansi-language: EN-US; mso-fareast-font-family: 'Times New Roman'; mso-bidi-font-family: Arial; mso-fareast-language: EN-GB; mso-themecolor: background1" lang=EN-US>smtpd.length.Content-Type&nbsp; </SPAN><SPAN style="FONT-FAMILY: 'Arial','sans-serif'; COLOR: white; FONT-SIZE: 10pt; mso-fareast-font-family: 'Times New Roman'; mso-fareast-language: EN-GB; mso-themecolor: background1"><o:p></o:p></SPAN></P>
<P style="MARGIN: 0cm 0cm 0pt" class=MsoNormal><SPAN style="FONT-FAMILY: 'Verdana','sans-serif'; COLOR: white; FONT-SIZE: 10pt; mso-ansi-language: EN-US; mso-fareast-font-family: 'Times New Roman'; mso-bidi-font-family: Arial; mso-fareast-language: EN-GB; mso-themecolor: background1" lang=EN-US>and&nbsp; </SPAN><SPAN style="FONT-FAMILY: 'Arial','sans-serif'; COLOR: white; FONT-SIZE: 10pt; mso-fareast-font-family: 'Times New Roman'; mso-fareast-language: EN-GB; mso-themecolor: background1"><o:p></o:p></SPAN></P>
<P style="MARGIN: 0cm 0cm 0pt" class=MsoNormal><SPAN style="FONT-FAMILY: 'Verdana','sans-serif'; COLOR: white; FONT-SIZE: 10pt; mso-ansi-language: EN-US; mso-fareast-font-family: 'Times New Roman'; mso-bidi-font-family: Arial; mso-fareast-language: EN-GB; mso-themecolor: background1" lang=EN-US>smtpd.length.Content-Disposition </SPAN><SPAN style="FONT-FAMILY: 'Arial','sans-serif'; COLOR: white; FONT-SIZE: 10pt; mso-fareast-font-family: 'Times New Roman'; mso-fareast-language: EN-GB; mso-themecolor: background1"><o:p></o:p></SPAN></P></SPAN></FONT></o:p></SPAN>]]></content:encoded>
    </item>
    <item>
      <title>Best Practices to have in mind before submitting a script to MS for analysis</title>
      <link>https://docs.microsoft.com/archive/blogs/postwoman/best-practices-to-have-in-mind-before-submitting-a-script-to-ms-for-analysis</link>
      <pubDate>Tue, 04 Aug 2009 17:33:00 GMT</pubDate>
      <dc:creator><![CDATA[Claudia S Machado]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.technet.microsoft.com/postwoman/2009/08/04/best-practices-to-have-in-mind-before-submitting-a-script-to-ms-for-analysis/</guid>
      <description><![CDATA[These are some tips I have had to give to customers&nbsp;that will help us go through the code and...]]></description>
      <content:encoded><![CDATA[<P>These are some tips I have had to give to customers&nbsp;that will help us go through the code and overall&nbsp;help you as well :)</P>
<P>-&nbsp;Naming standardization of variables &amp; constants should be respected throughout the script.<BR>-&nbsp;Exhaustive documentation of your script by using inline comments.<BR>-&nbsp;Error and exception handling: trapping error codes and logging exhaustively operations performed by the script (in case of script malfunction, you will have exhaustive data to troubleshoot and correct issues in a minimum of time and without having to adapt your code).<BR>-&nbsp;Planning environment’s evolutions by separating Exchange servers declarations and the core script so&nbsp;the guys&nbsp;not developing will be able to add/remove/modify servers without any script knowledge and without having to modify the core script =&gt; usage of a parameter file is strongly recommended in that case.</P>]]></content:encoded>
    </item>
    <item>
      <title>Getting Linked Mailboxes after migrating from E2K3 to E2K7?</title>
      <link>https://docs.microsoft.com/archive/blogs/postwoman/getting-linked-mailboxes-after-migrating-from-e2k3-to-e2k7</link>
      <pubDate>Tue, 04 Aug 2009 17:29:00 GMT</pubDate>
      <dc:creator><![CDATA[Claudia S Machado]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.technet.microsoft.com/postwoman/2009/08/04/getting-linked-mailboxes-after-migrating-from-e2k3-to-e2k7/</guid>
      <description><![CDATA[This issue can occur if the associated external account was set on the user's Microsoft Exchange...]]></description>
      <content:encoded><![CDATA[<P>This issue can occur if the associated external account was set on the user's Microsoft Exchange Server 2003 or Exchange 2000 Server mailbox.<BR>The idea here it to modify msExchRecipientTypeDetails attribute (you can do it with ADSI Edit) but here we will do it using VBScript:</P>
<P>NOTE: Following programming examples is for illustration only, without warranty either expressed or implied, including, but not limited to, the implied warranties <BR>of merchantability and/or fitness for a particular purpose. This sample code assumes that you are familiar with the programming language being demonstrated and <BR>the tools used to create and debug procedures. This sample code is provided for the purpose of illustration only and is not intended to be used in a production environment. </P>
<P>=============</P>
<P>Dim obj<BR>'ToDo: Modifiy the UserAlias, Domain, DomainExtn<BR>Set obj = <BR>GetObject("<A href="ldap://CN=UserAlias,CN=Users,DC=Domain,DC=DomainExtn/" mce_href="ldap://CN=UserAlias,CN=Users,DC=Domain,DC=DomainExtn/">LDAP://CN=UserAlias,CN=Users,DC=Domain,DC=DomainExtn</A>")<BR>obj.msExchRecipientTypeDetails = 1<BR>obj.SetInfo()<BR>Set obj = nothing</P>
<P>=============</P>]]></content:encoded>
    </item>
    <item>
      <title>Enabling and Disabling OWA, IMAP4 and POP3 in E2K3 via VBScript</title>
      <link>https://docs.microsoft.com/archive/blogs/postwoman/enabling-and-disabling-owa-imap4-and-pop3-in-e2k3-via-vbscript</link>
      <pubDate>Tue, 04 Aug 2009 17:11:00 GMT</pubDate>
      <dc:creator><![CDATA[Claudia S Machado]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.technet.microsoft.com/postwoman/2009/08/04/enabling-and-disabling-owa-imap4-and-pop3-in-e2k3-via-vbscript/</guid>
      <description><![CDATA[I've had this request from a customer and aparently its something some people have problems with:...]]></description>
      <content:encoded><![CDATA[<P>I've had this request from a customer and aparently its something some people have problems with: </P>
<P mce_keep="true">&nbsp;</P>
<P>NOTE: Following programming examples is for illustration only, without warranty either expressed or implied, including, but not limited to, the implied warranties of merchantability and/or fitness for a particular purpose. This sample code assumes that you are familiar with the programming language being demonstrated and the tools used to create and debug procedures. This sample code is provided for the purpose of illustration only and is not intended to be used in a production environment. </P>
<P mce_keep="true">&nbsp;</P>
<P>'"""""""""""""""""""""""""""""""""""""""’&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </P>
<P>'" ENABLEOWAIMAP4andPOP3.VBS</P>
<P>'"</P>
<P>'" Enables Exchange Server 2003 OWA, IMAP4 and POP3 for the specified OU in the default domain</P>
<P>'"</P>
<P>'" usage: cscript enableowaimappop</P>
<P>'"</P>
<P>'"""""""""""""""""""""""""""""""""""""""’</P>
<P>'‘ values for the ProtocolSettings Exchange attribute that can be modified.</P>
<P>'‘ HTTP§0§1§§§§§§ = disabled</P>
<P>'‘ HTTP§1§1§§§§§§ = enabled</P>
<P>'‘ IMAP4§0§1§4§ISO-8859-1§0§1§0§0 = disabled</P>
<P>'‘ IMAP4§1§1§4§ISO-8859-1§0§1§0§0 = enabled</P>
<P>'‘ POP3§0§1§4§ISO-8859-1§0§§§ = disabled</P>
<P>'‘ POP3§1§1§4§ISO-8859-1§0§§§ = enabled</P>
<P>'"""""""""""""""""""""""""""""""""""""""’</P>
<P>dim usrstring&nbsp; </P>
<P>Set ObjOU=GetObject("<A href="ldap://OU=IT,DC=mamado,DC=test,DC=com/" mce_href="ldap://OU=IT,DC=mamado,DC=test,DC=com/">LDAP://OU=IT,DC=mamado,DC=test,DC=com</A>")&nbsp; </P>
<P>For Each User in ObjOU&nbsp; </P>
<P>usrstring = "<A href="ldap://CN/" mce_href="ldap://CN/">LDAP://CN</A>=" &amp; user.get("cn") &amp; ",OU=IT,DC=mamado,DC=test,DC=com"&nbsp; </P>
<P>Set ObjUser=GetObject(usrstring)&nbsp; </P>
<P>For Each protocolSettings in ObjUser.GetEx("protocolSettings")&nbsp; </P>
<P>If Left(protocolSettings, 3) = "HTTP" Then&nbsp; </P>
<P>ObjUser.PutEx 3, "protocolSettings", Array(protocolSettings)&nbsp; </P>
<P>ObjUser.SetInfo&nbsp; </P>
<P>End If&nbsp; </P>
<P>Next&nbsp; </P>
<P>ObjUser.PutEx 3, "protocolSettings", Array("HTTP§1§1§§§§§§", "IMAP4§1§1§4§ISO-8859-1§0§1§0§0", "POP3§1§1§4§ISO-8859-1§0§§§")&nbsp; </P>
<P>ObjUser.SetInfo&nbsp; </P>
<P>Next&nbsp; </P>
<P mce_keep="true">=========================</P>
<P>'"""""""""""""""""""""""""""""""""""""""’&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </P>
<P>'" DISABLEOWAIMAP4andPOP3.VBS</P>
<P>'"</P>
<P>'" Disables Exchange Server 2003 OWA, IMAP4 and POP3 for the specified OU in the default domain</P>
<P>'"</P>
<P>'" usage: cscript disableowaimappop</P>
<P>'"</P>
<P>'"""""""""""""""""""""""""""""""""""""""’</P>
<P>'‘ values for the ProtocolSettings Exchange attribute that can be modified.</P>
<P>'‘ HTTP§0§1§§§§§§ = disabled</P>
<P>'‘ HTTP§1§1§§§§§§ = enabled</P>
<P>'‘ IMAP4§0§1§4§ISO-8859-1§0§1§0§0 = disabled</P>
<P>'‘ IMAP4§1§1§4§ISO-8859-1§0§1§0§0 = enabled</P>
<P>'‘ POP3§0§1§4§ISO-8859-1§0§§§ = disabled</P>
<P>'‘ POP3§1§1§4§ISO-8859-1§0§§§ = enabled</P>
<P>'"""""""""""""""""""""""""""""""""""""""’</P>
<P>dim usrstring&nbsp; </P>
<P>Set ObjOU=GetObject("<A href="ldap://OU=IT,DC=mamado,DC=test,DC=com/" mce_href="ldap://OU=IT,DC=mamado,DC=test,DC=com/">LDAP://OU=IT,DC=mamado,DC=test,DC=com</A>")</P>
<P>For Each User in ObjOU</P>
<P>usrstring = "<A href="ldap://CN/" mce_href="ldap://CN/">LDAP://CN</A>=" &amp; user.get("cn") &amp; ",OU=IT,DC=mamado,DC=test,DC=com"</P>
<P>Set ObjUser=GetObject(usrstring)</P>
<P>ObjUser.Put "protocolSettings", Array("HTTP§0§1§§§§§§", "IMAP4§0§1§4§ISO-8859-1§0§1§0§0", "POP3§0§1§4§ISO-8859-1§0§§§")</P>
<P>ObjUser.SetInfo</P>
<P>Next</P>
<P mce_keep="true">&nbsp;</P>]]></content:encoded>
    </item>
    <item>
      <title>Here is a sample code to list delegates of the Outlook Mailbox using CDO 1.2.1 via VBScript</title>
      <link>https://docs.microsoft.com/archive/blogs/postwoman/here-is-a-sample-code-to-list-delegates-of-the-outlook-mailbox-using-cdo-1-2-1-via-vbscript</link>
      <pubDate>Tue, 04 Aug 2009 17:07:00 GMT</pubDate>
      <dc:creator><![CDATA[Claudia S Machado]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.technet.microsoft.com/postwoman/2009/08/04/here-is-a-sample-code-to-list-delegates-of-the-outlook-mailbox-using-cdo-1-2-1-via-vbscript/</guid>
      <description><![CDATA[This is another simple request that customers do often:&nbsp;
NOTE: Following programming examples...]]></description>
      <content:encoded><![CDATA[<P>This is another simple request that customers do often:&nbsp;</P>
<P>NOTE: Following programming examples is for illustration only, without warranty either expressed or implied, including, but not limited to, the implied warranties of merchantability and/or fitness for a particular purpose. This sample code assumes that you are familiar with the programming language being demonstrated and the tools used to create and debug procedures. This sample code is provided for the purpose of illustration only and is not intended to be used in a production environment. </P>
<P>Dim objSession <BR>Dim strProfileInfo <BR>Dim strServer <BR>Dim strMailbox <BR>Dim objFolder<BR>Dim objMessages<BR>Dim objMessage<BR>Dim oFields<BR>Dim oField1<BR>Dim oField2<BR>Dim oFBFolder</P>
<P>'TODO:Change Server and Mailbox info<BR>strServer="Server"<BR>strMailbox="User"</P>
<P>strProfileInfo = strServer &amp; vbLf &amp; strMailbox</P>
<P>Set objSession = CreateObject("MAPI.Session")<BR>objSession.Logon , , False, False, , True, strProfileInfo</P>
<P>writelog( "Mailbox")</P>
<P>writelog( " ==&gt; ")<BR>writelog( objSession.CurrentUser)<BR>writelog( vbCrLf)<BR>Msgbox "Logged On!!!"</P>
<P>' Reference the root folder by passing ID of ""<BR>Set oRoot = objSession.GetFolder("")</P>
<P>'Connect to the Freebusy folder<BR>Set oFBFolder = oRoot.Folders.Item("Freebusy Data")<BR>Set objMessages = oFBFolder.Messages</P>
<P>For Each objMessage In objMessages</P>
<P>If objMessage.subject = "LocalFreebusy" Then<BR>'Get the message fields</P>
<P>Set oFields = objMessage.Fields</P>
<P>On Error Resume Next</P>
<P>For i = 0 to UBound(oFields.Item(&amp;H6844101E).Value(0))</P>
<P>Set oField1 = oFields.Item(&amp;H6844101E) ' <BR>PR_SCHDINFO_DELEGATE_NAMES<BR>writelog "DELEGATE NAMES ==&gt; " &amp; oField1.Value(0)(i)<BR>writelog( vbCrLf)</P>
<P>Set oField2 = oFields.Item(&amp;H686B1003) ' <BR>PR_DELEGATE_FLAGS<BR>writelog "Delegate can see private ==&gt; " &amp; oField2.Value(0)(i)<BR>writelog( vbCrLf)<BR>Next<BR>End iF<BR>Next</P>
<P>objSession.Logoff</P>
<P>Set objSession =Nothing</P>
<P>Set oField1 = Nothing<BR>Set oField2 = Nothing<BR>Set oFBFolder = Nothing<BR>Set oRoot = Nothing</P>
<P>Msgbox "Done!!!"</P>
<P>Sub WriteLog(ByVal strMessage)<BR>Dim fs<BR>Set fs = CreateObject("Scripting.FileSystemObject")<BR>Dim file<BR>Dim sScriptPath<BR>sScriptPath = Left(WScript.ScriptFullName, InstrRev(WScript.ScriptFullName, <BR>"\"))<BR>Set file = fs.opentextfile(sScriptPath &amp; "DelegateListLog.txt", 8, True)<BR>file.Write strMessage<BR>file.Close<BR>End Sub<BR>.csharpcode, .csharpcode pre { font-size: small; color: black; font-family: <BR>consolas, "Courier New", courier, monospace; background-color: #ffffff; <BR>/*white-space: pre;*/ } .csharpcode pre { margin: 0em; } .csharpcode .rem { color: <BR>#008000; } .csharpcode .kwrd { color: #0000ff; } .csharpcode .str { color: #006080; <BR>} .csharpcode .op { color: #0000c0; } .csharpcode .preproc { color: #cc6633; } <BR>.csharpcode .asp { background-color: #ffff00; } .csharpcode .html { color: #800000; <BR>} .csharpcode .attr { color: #ff0000; } .csharpcode .alt { background-color: <BR>#f4f4f4; width: 100%; margin: 0em; } .csharpcode .lnum { color: #606060; } </P>
<P>Please refer to the following MAPI properties used in the above sample to list delegates of the mailbox:<BR>PidTagScheduleInfoDelegateNames Canonical Property <BR>&lt;<A href="https://msdn.microsoft.com/en-us/library/cc839497.aspx" mce_href="https://msdn.microsoft.com/en-us/library/cc839497.aspx">https://msdn.microsoft.com/en-us/library/cc839497.aspx</A>&gt; <BR>Contains the names of the delegates. <BR>Associated properties: PR_SCHDINFO_DELEGATE_NAMES, PR_SCHDINFO_DELEGATE_NAMES_A, <BR>PR_SCHDINFO_DELEGATE_NAMES_W <BR>Identifier: 0x6844 <BR>PidTagDelegateFlags Canonical Property <BR>&lt;<A href="https://msdn.microsoft.com/en-us/library/cc815505.aspx" mce_href="https://msdn.microsoft.com/en-us/library/cc815505.aspx">https://msdn.microsoft.com/en-us/library/cc815505.aspx</A>&gt; <BR>Specifies whether a delegate can view the delegator’s private message objects. <BR>Associated properties: PR_DELEGATE_FLAGS <BR>Identifier: 0x686B <BR>If you interested in exploring further details regarding how delegate settings works in Outlook then refer to:<BR>[MS-OXODLGT]: Delegate Access Configuration Protocol Specification <BR>&lt;<A href="https://msdn.microsoft.com/en-us/library/cc425488.aspx" mce_href="https://msdn.microsoft.com/en-us/library/cc425488.aspx">https://msdn.microsoft.com/en-us/library/cc425488.aspx</A>&gt; <BR>However, if you just targeting Exchange Server 2007, I would highly recommend you to use EWS(Exchange Web Services)<BR></P>]]></content:encoded>
    </item>
  </channel>
</rss>