BizTalk Developer Tools: Papercut

 Published by: Bill Chesnut

I have decided to start a series of blog post on the tools I use as a BizTalk developer, some of the tools are not only for BizTalk but provide functionality for BizTalk developers

The 1st tool that I am going to talk about is Papercut (http://papercut.codeplex.com), Papercut is a simplified SMTP server that can be use for sending email message from BizTalk or SQL.  I have found over the years that sending emails from a BizTalk developer/test environment is very hard to setup and very error prone, lots of the test data supplied to developers have real email addresses in it and the last thing a developer wants to do is send a test email to a real user.  This is why Papercut is so good, as far as BizTalk and SQL are concerned Papercut is a real live mail server to send emails to, but in reality it is a local service that accepts and stores the email sent.

Installing

Download Papercut from codeplex and run the installer:

Select the Click Once or Zip Installer

image

Open the Click Once

Click Install

image

Wait for the Installation to Complete

image

Click Run (up to you to un-check the “Always ask before opening this file”)

 

image

Installation Complete

image

Configuring BizTalk

There are several ways to configure BizTalk but the best is via the adapter properties:

In the BizTalk Administrator Console, Expand BizTalk Group, Expand Platform Settings, Expand Adapters, Click SMTP, Right Click on Send Handler, Click Properties

image

From the SMTP – Adapter Handler Properties Dialog, Click Properties

image

Configure as follows (the From address can be anything you choose), Click OK

image

Repeat these steps for All SMTP Send Handlers

Configuring BAM Alerts

To Configure BAM Alerts, with SQL 2012 or SQL 2014, it is necessary to Setup Database Mail:

In SQL Server 2014 Management Studio, Expand Management, Right Click Database Mail, Click Configure Database Mail

image

Click Next

image

Select Set up Database Mail but performing the following tasks:, Click Next

image

Click Yes

image

Configure the Profile Name and Description as shown and Click Add

image

Configure as shown (email address can be anything you choose), Click Ok

image

Click Next

image

Click Public, Click Next (public profile does not matter since mail setup is completely local)

image

Click Next

image

Click Finish

image

Wait for configuration to finish, Click Close

image

Database Mail is now Configured

Right Click on Database Mail, Select Send Test E-Mail…

image

Fill in To email and Click Send Test E-Mail

image

The following notification should appear, Click the Notification

image

Papercut Opens and show the test email, click Delete, close Papercut

image

Click OK

image

Now that Database Mail is configured and tested, Open the BizTalk Server Configuration, Click BAM Alerts, Click Enable, Enter BAM Alerts User, Enter SQL Server for Alerts databases, Click Apply Configuration

image

Click Next

image

Wait for the Configuration to complete, Click Finish, Close Microsoft BizTalk Server Configuration

image

BAM Alerts are now configured

Testing

To Test send emails, I have deployed the SDK Orchestration sample Hello World, I have then created a new Send Port called HelloWorldSendPortEmail:

Configure As Shown, Click Configure

image

Fill in Email Address and Subject (with your choice of values), click Compose

image

Click Text and Enter some text, Click Attachments

image

Select “Attach only body part”, Click OK

image

Click OK

image

Stop the Microsoft.Sample.BizTalk.HelloWorld Orchestration and rebind the send port to the new Email send port, Click Ok and start the Orchestration

image

Drop a copy of the SamplePOInput.xml file in the In directory, the notification below should appear, click on the notification

image

In Papercut, click on Raw and scroll down to the attachment

image

Testing is complete

Conclusion

I hope that you can get as much use out of Papercut as I have and that it make developing BizTalk solutions faster and simpler.

Please stay tuned for my next installment in my BizTalk Developer Tools series.

Comments are closed.