Friday 31 January 2014

Handling SMTP Server on Windows 7


I want to share some thoughts which I have encountered while trying my hands on Biztalk 2010.
From last few days I was thinking to note my technical experiences somewhere and I found this as one of the best way to do so.

So to start with I will take a scenario which I am trying from last couple of days.
In this scenario, we wanted to implement error handling and if error occurs then we have to send the error content to the customer’s Email address (which we get dynamically).
To send mail from Biztalk we have to use SMTP server.


There are two mechanisms through which we can send email out from Biztalk.
1) For Dynamic Email routing – Handle the SMTP configuration in Orchestration.
2) For Static Email Routing – Handle the SMTP at send port.


To do this I am using the machine with following configuration:
1) Microsoft Visual Studio 2010.
2) Microsoft Biztalk Server 2010.
3) IIS6
4) Operating System – Windows 7 Enterprise.


Ok then let’s start with creating solution for the given problem.
First question comes in the picture is can I implement all this with the given development machine?
Ans -- "No"


Reasons (In the sequence I figured out those) :

IIS6 does not provide SMTP server at all
                So for this I have installed IIS7, which provides SMTP server.

Windows 7 does not ship with any SMTP Server capabilities.
                This means even though I have install SMTP on my machine (through IIS7), I can’t send out the mails from it. The reason is Windows don’t have actual Virtual  SMTP Server which is responsible to sending the mails.



Then I tried the same scenario on the server machine with following configuration:
1) Microsoft Visual Studio 2010.
2) Microsoft Biztalk Server 2010.
3) IIS6
4) Operating System – Windows Server 2007 Enterprise.


And guess what it worked on the above mentioned machine.. In the specified error scenario Mail was getting composed and got send to the recipient.


But still I have to figure out some solution by which I can do same through my development machine. So after a lot of surfing, forum QA, senior’s input I got the solution.

Someone suggest me to download smtp4dev. This acts a virtual smtp  server. It is supported on Windows XP/Vista/7. This provides us simulation of SMTP.
When I used this virtual SMTP server, It actually accepts the message sent from biztalk and sends the mail to recipient (simulation – Actually mail does not get sent).




Generated mail by this downloaded patch is as below



You can check more details/insights about this on below link
http://social.technet.microsoft.com/forums/windows/en-US/8da833fe-634c-4698-98f2-74506f043aee/smtp-virtual-server-in-windows-7


SO this is what I have learned in last couple of days. Even though this has not solved the question but it gives me some thought to bite my nails..


Thanks.. will be back very soon..