Walkthrough: Creating a BizTalk Application That Uses the POP3 Adapter
This section takes you through creating a simple Microsoft BizTalk Server application using the POP3 adapter.
The application assumes that you have access to a computer running Microsoft Windows Server 2003 or Windows Server 2008 SP2 with Email Services installed and configured. For information about configuring Windows Server 2003 or Windows Server 2008 SP2 with Email Services see Windows Server Help.
In this example Microsoft Outlook Express is used as the e-mail client and Windows Server 2003 or Windows Server 2008 SP2 is used as the e-mail server. However, any POP3 e-mail client and RFC-compliant POP3 server could be used for this scenario.
This application assumes that you have not yet created any send ports or receive locations. If you have existing send ports or receive locations, substitute appropriate names when you work through the steps.
The application is a simple content-based routing application using only a receive location and a send port. The receive location reads from a mailbox on the server running Windows Server 2003 or Windows Server 2008 SP2("the Windows server"). The send port takes the message from the receive location and sends it to a folder on the local file system of the BizTalk Server.
To create the application, you have to create the mailbox, set up the BizTalk Server receive location and send port, start the send port and enable the receive location, and send a test message to the mailbox. Follow the steps below to create the application.
Create a mailbox on Windows Server 2003
To create a mailbox on Windows Server 2003 with Email Services installed, follow these steps:
Click Start, point to Programs, point to Administrative Tools, and then click POP3 Service.
Expand <servername> and click the domain where you would like to create a mailbox.
In the POP3 Service dialog box, in the right pane, click the Add Mailbox option.
In the Add Mailbox dialog box, in the Mailbox Name box, type EmailTest.
Select the Create associated user for this mailbox check box.
In the Password and Confirm Password boxes, type a password, and then click OK.
Make a note of the Account name and Mail Server log on information displayed for use with clear text authentication in the POP3 Service dialog box, and then click OK. This information will be used by the BizTalk Server receive location that you configure with the POP3 transport type.
Create the receive location
Follow these steps to create the receive location:
In the BizTalk Server Administration console double-click the default database <machine_name>.BizTalkMgmtDb.dbo, where machine_name is the name of your computer. Click Applications, then click BizTalk.Application.1.
Right-click Receive Ports, click New, click One-way receive port.
In the Receive Port Properties dialog box, in the Name box, type POP3Receive.
Click Receive Locations, and then click New. In the Receive Location Properties dialog box, in the Name box, type POP3Receive.
In the Transport Type box, select POP3.
In the Receive Handler box, select BizTalkServerApplication.
In the Receive Pipeline box, select Microsoft.BizTalk.DefaultPipelines.PassThruReceive.
In the Transport box, click the Configure button.
In the POP3 Transport Properties dialog box, in the Apply MIME Decoding box, select False.
In the Mail Server box, type the name of the Windows Server-based server where you created a mailbox.
In the Authentication Scheme box, select Basic.
In the Password box, click the drop-down arrow and type the password for the mailbox.
In the User Name box, type the fully qualified user name for the mailbox, for example email@example.com_domain.
In the Polling Interval box, type 1, click OK, and then click OK again.
Create the send port and destination folder on the BizTalk server
Follow these steps to create the send port and destination folder on the BizTalk Server:
Create a folder on the BizTalk Server file system. This will be the destination for the send port.
Right-click Send Ports, click New, then click Static one-way Send Port.
In the Send Port Properties dialog box, in the Transport Type box, select FILE.
In the Name box, type SendToFile.
In the Transport box, click the Configure button.
Next to the Destination folder box, click Browse, select the folder that you created on the BizTalk Server, and then click OK.
In the File name box, type %MessageID%.txt, and then click OK.
In the Send Pipeline box, select Microsoft.BizTalk.DefaultPipelines.PassThruTransmit.
In the Property box, select BTS.ReceivePortName.
In the Value box, type POP3Receive, and then click OK.
Enable the receive location and start the send port
Follow these steps to enable the receive location and start the send port:
Right-click the POP3Receive receive location, and then click Enable.
Right-click the SendToFile send port, and then click Start.
The next step is to test the application by sending a test message to the mailbox monitored by the receive location.
Configure Outlook Express to send an e-mail message to the mailbox
Follow these steps to configure Outlook Express to send an e-mail message to the mailbox:
Click Start, point to Programs, and then click Outlook Express.
In Outlook Express, on the Tools menu, click Accounts.
Click Add and then click Mail.
In the Display name box, type a display name, and then click Next.
In the Internet E-mail address dialog box, in the E-mail address box, type EmailTest@<domain_name>, and then click Next.
Make sure to enter the appropriate value for <domain_name>. This value should match the name of the domain under which this mailbox was created in the POP3 Service Administration interface on the Windows server.
In the E-mail Server names dialog box, in the Incoming mail and Outgoing mail boxes, type the server name or IP address of the Windows server, and then click Next.
In the Internet Mail Logon dialog box, in the Account name box, type EmailTest.
In the Password box, type the password for the EmailTest account, select the Remember password option, click Next, and then click Finish.
Click to select the account that you just created, and then click Properties.
In the Properties dialog box, click the Advanced tab, click to select the option to Leave a copy of messages on the server, and then click OK.
In the Internet Accounts dialog box, click Close.
Use Outlook Express to compose a test message, type Test into the Subject field, and type EmailTest@<domain_name> into the To field.
Click Send to send the test message. To ensure that Outlook Express sends the test message immediately, click the Send/Recv button in the Outlook Express toolbar.
View the message
Follow these steps to view the message:
Use Windows Explorer to open the folder that you specified as the Destination Folder for the send port.
Double click the document in the folder to view the contents of the document in Notepad.