Transport Provider Sample
This content is outdated and is no longer being maintained. It is provided as a courtesy for individuals who are still using these technologies. This page may contain URLs that were valid when originally published, but now link to sites or pages that no longer exist.
This sample uses files and directories to transmit and receive messages. It implements and registers a very simple preprocessor that appends a line of text to each outbound message. The sample illustrates how to split message content between Transport Neutral Encapsulation Format (TNEF) and text. It also supports all configuration options (property sheets, wizards, and programmatic configuration) and message options. It does not support the remote transport interfaces.
You can download this sample from Outlook Messaging API (MAPI) Code Samples.
Executable: |
mrxp32.dll |
Source code directory: |
SampleTransportProvider\MRXP |
Language: |
C++ |
Platforms: |
Visual Studio 2008 to compile for Windows Vista, Windows Server 2008, Windows XP SP2, and Windows Server 2003 SP1 |
Supported Features
This sample supports the following features:
Basic features such as sending, receiving, and polling for new messages.
Interactive and programmatic configuration.
The IMAPIStatus interface, except for property setting. For more information, see the IMAPIStatus : IMAPIProp interface.
Thread safety.
Event logging to a text file. The file is automatically limited to a specified size. All transport sessions use the same file.
Unsupported Features
This sample does not support asynchronous detection of incoming messages.
To install the Sample Transport Provider
To download the Sample Transport Provider, see Downloading the Outlook 2007 MAPI Samples.
Locate the folder where you saved the Outlook 2007 MAPI Samples. Right-click the OutlookMAPISamples-<version number> zip folder and click Extract All.
Click Browse, select the location where you want to save the sample, and click Extract.
Run Visual Studio 2008.
In Visual Studio 2008, click File, select Open, and then click Project/Solution.
Browse to the location where you saved the sample, click mrxp32.vcproj, and then click Open.
On the Build menu, click Configuration Manager.
In the Configuration Manager dialog box, go to the mrxp32 row, and in the Configuration column select Release, and then click Close.
On the Build menu, click Build Solution.
In the Save File As dialog box, click Save.
In the folder where you saved the sample, right-click the installation batch file and click Run as administrator.
In the User Account Control dialog box, click Continue.
Note
install.bat copies the .dll to the default Microsoft Office installation folder, C:\Program Files\Microsoft Office\Office12\. If you have installed Office products in a different location, right-click install.bat and click Edit. The file opens in Notepad. Replace the default installation path with the installation path used on your computer.
To set up the Transport Provider in Outlook 2007
On the Tools menu of Outlook 2007, click Account Settings.
In the Account Settings dialog box, on the E-mail tab, click New.
Under Choose E-mail Service click Other, select MRXP Sample Transport, and then click Next.
In the MRXP Transport Configuration dialog box type a User Display Name.
Under Path to Inbox (UNC Share) enter a folder path. This can also be a path to a local folder.
Important This path must exist.
Click OK.
In the Add E-mail Account dialog box click OK. Click Finish and then click Close.
To start using the MRXP account, exit and restart Outlook.
To use the Transport Provider Sample to send a message in Outlook 2007
On the File menu, click New, and then click Mail Message.
In the To box type the name of the recipient using the format [MRXP:<ADDRESS>]. The address is the UNC share or local folder path to the recipient's inbox.
Note
If there are colons or backslashes in the address, you must insert a backslash before each colon or backslash. For example, to send mail to [MRXP:C:\Mail\myDir] you must type [MRXP:C\:\\Mail\\myDir].
Important The recipient address must exist.
Click Account and then click MRXP Sample Transport.
Type your message and click Send. The message is sent using the MRXP transport provider.
To use the Transport Provider Sample to receive a message in Outlook 2007
On the File menu, click New, and then click Mail Message.
Type your message.
Click the Microsoft Office Button, click Save As, and then click Save As to save the file to the inbox folder you specified during setup.
In the Save As dialog box, browse to the UNC share or local folder that you set as your inbox.
In the Save as type drop down, click Outlook Message Format.
Type a name for the file and click Save.
The file is saved to the shared folder. The MRXP transport provider delivers the message to your Inbox in Outlook.