Welcome to my website, in the following pages you will find information about my experience, publications, Apps I developed, and a synopsis of the services I provide in the areas of Mobile App development, Custom Web App development, general software development, design, and architecture. As a software consultant, I worked many roles including Software Developer, Integration Architect, SOA / Enterprise Architect, Technical Lead, and Instructor. I mainly provide services in the GTA (Toronto, ON), though I have provided services in Calgary AB, St Johns NFLD, Chicago IL, New York NY, Houston TX, and Denver CL.
I specialize in the following Technologies :
- Operating Systems: iOS , Android, Windows, Linux, Mac
- Portals, SharePoint 2007,2010, and 2013, ASP.Net MVC, ASP.Net
- Cloud: Azure Websites, Amazon Storage Services
- Databases: MSSQL, Oracle, DB2, MySql
- Big Data: Hadoop, Spark
- Integration Platforms: BizTalk , MS ESB Toolkit, ESBExpress, WCF, Windows Workflows
My Published Books:
- Mastering the BizTalk Technical Interview
- BizTalk The Practical Course
Books I have reviewed:
- MDX Queries for SQL Server 2012 August 2013
- Applied Architecture Patterns on the Microsoft Platform second edition July 2014
Feel free to contact me at Moustafa@MoustafaRefaat.com if you have any questions regarding any of my posts, books, services, or products.
BTS: Sending Email in HTML or Text Format form BizTalk 2004
I needed to send an email directly from BTS 2004; this was part of an error handling mechanism. However going through a Schema was too much all I needed is to be able to assemble a string and send it through a SMTP port. As you know E-mail messages always contain message text, generally in a text or html format, and may contain one or more attachments as well. I needed to send the Email in HTML format. After going through the SDK and the documentation, I could not find an easy well documented solution for this. So I had to assemble the solution attached with this submission.
Sending a message of type System.String will not work, because the string gets formatted as an XML document in the message, which is not my desired solution. To send text in an e-mail message, you must use a special type of string, a string that has special serialization with the XML, in other words implements IFormatter interface. In the attached solution you will find class “RawString” which implements IFormatter. You also need to implement a pipeline containing the MIME/SMIME Encoder pipeline component. Now we have to tell the MIME/SMIME pipeline component that it is dealing with a body with content type of text/html through
The Microsoft.XLANGs.BaseTypes.XLANGPart.SetPartProperty method.
So the solution consists of
- A library class that contains the RawString class and Part class to make it easy to set the type of the message
- A BTS project that contain a pipeline to use for sending the email.
- A simple orchestration that accepts a simple file schema and just sends the email. The input file in this example is empty it is just used to fire the orchestration.
Hope this would make your development project easier. Let me know what you think . You can download the code
from the downloads and Samples