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
Open the Click Once
Click Install
Wait for the Installation to Complete
Click Run (up to you to un-check the “Always ask before opening this file”)
Installation Complete
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
From the SMTP – Adapter Handler Properties Dialog, Click Properties
Configure as follows (the From address can be anything you choose), Click OK
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
Click Next
Select Set up Database Mail but performing the following tasks:, Click Next
Click Yes
Configure the Profile Name and Description as shown and Click Add
Configure as shown (email address can be anything you choose), Click Ok
Click Next
Click Public, Click Next (public profile does not matter since mail setup is completely local)
Click Next
Click Finish
Wait for configuration to finish, Click Close
Database Mail is now Configured
Right Click on Database Mail, Select Send Test E-Mail…
Fill in To email and Click Send Test E-Mail
The following notification should appear, Click the Notification
Papercut Opens and show the test email, click Delete, close Papercut
Click OK
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
Click Next
Wait for the Configuration to complete, Click Finish, Close Microsoft BizTalk Server Configuration
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
Fill in Email Address and Subject (with your choice of values), click Compose
Click Text and Enter some text, Click Attachments
Select “Attach only body part”, Click OK
Click OK
Stop the Microsoft.Sample.BizTalk.HelloWorld Orchestration and rebind the send port to the new Email send port, Click Ok and start the Orchestration
Drop a copy of the SamplePOInput.xml file in the In directory, the notification below should appear, click on the notification
In Papercut, click on Raw and scroll down to the attachment
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.