none
How are you guys sending SMTP email after file send?

    Întrebare

  • My end users are asking for a notification email when a BT output file gets generated/sent.

    I implemented an SMTP class (which works fine) in my send pipeline. It sends an email at the end of the execute method as the file is pushed out of the pipeline. I was just wondering is this the preferred way to do this and if not how would you implement this action?

    3 martie 2012 12:18

Răspunsuri

  • Hi 

    If it works for you then I guess it should be OK.

    I would do following, to implement the above :

    • in the orchestration , I would use delivery notification property of the send port
    • I would decide if there is no failure while sending the message using delivery notification ACK message
    • Then I would send the email alert using a SMTP send port.

    There is a very good post here and a msdn page here, which you can refer to get more details about Delivery Notification and Send Port in orchestration.

    I hope that helps!

    HTH,Naushad (MCC/MCTS) http://alamnaushad.wordpress.com,My New Technet Wiki Article “BizTalk Server: Performance Tuning & Optimization"

    If this is helpful or answers your question - please mark accordingly! Please "Vote As Helpful" if this was useful while resolving your question!

    3 martie 2012 15:00
    Moderator
  •  I would like to combine the suggestions of both Naushad and Tord and would suggestion the following solution:

    To make use of delivery notifications you can create a pipeline component that you can use in the send pipeline in pre-assemble stage and use the following code in the implementation of execute method. It would be better idea to provide users a configurable property to enable/disable the delivery notification.

    public IBaseMessage Execute(IPipelineContext pContext, IBaseMessage inMsg)
    {
        //You can use the configurable property to enable/disable notification
        inMsg.Context.Promote("AckRequired","http://schemas.microsoft.com/BizTalk/2003/system-properties",true);
        return inMsg;
    }

    Then create a send port with filter BTS.AckType == “ACK” to send the Acknowlegment through e-mail.

    In this way you don’t need to create any extra orchestration and e-mail address can be changed easily as and when required on send port.


    Please mark the post answered your question as answer, and mark other helpful posts as helpful, it'll help other users who are visiting your thread for the similar problem, Regards -Rohit Sharma (http://rohitbiztalk.blogspot.com)

    4 martie 2012 20:51
    Moderator
  • Hi,

    You have met the requirement of sending an email when file is generated. You have think for yourself if solution is fit for purpose and easy to maintain i.e. changes to functionality of send email. You state you created a SMTP class with implementation of functionality and that it works. So in my opinion you have met requirement of end user. I would not look for alternatives. I assume you have made it dynamic in a sense that you can change the email address e.a. through configuration.

    HTH

    Steef-Jan Wiggers

    MVP & MCTS BizTalk Server 2010

    http://soa-thoughts.blogspot.com/ | @SteefJan

    If this answers your question please mark it accordingly


    BizTalk

    5 martie 2012 04:14
    Moderator

Toate mesajele

  • Hi 

    If it works for you then I guess it should be OK.

    I would do following, to implement the above :

    • in the orchestration , I would use delivery notification property of the send port
    • I would decide if there is no failure while sending the message using delivery notification ACK message
    • Then I would send the email alert using a SMTP send port.

    There is a very good post here and a msdn page here, which you can refer to get more details about Delivery Notification and Send Port in orchestration.

    I hope that helps!

    HTH,Naushad (MCC/MCTS) http://alamnaushad.wordpress.com,My New Technet Wiki Article “BizTalk Server: Performance Tuning & Optimization"

    If this is helpful or answers your question - please mark accordingly! Please "Vote As Helpful" if this was useful while resolving your question!

    3 martie 2012 15:00
    Moderator
  • Just to make you aware, what will happen if the email is changed? The person who receives the notification quits, how do you edit the email address?

    Best regards

    Tord Glad Nordahl
    Bouvet ASA, Norway
    http://www.BizTalkAdmin.com |@tordeman

    Please indicate ”Mark as Answer” if this post has answered the question.

    4 martie 2012 18:17
  •  I would like to combine the suggestions of both Naushad and Tord and would suggestion the following solution:

    To make use of delivery notifications you can create a pipeline component that you can use in the send pipeline in pre-assemble stage and use the following code in the implementation of execute method. It would be better idea to provide users a configurable property to enable/disable the delivery notification.

    public IBaseMessage Execute(IPipelineContext pContext, IBaseMessage inMsg)
    {
        //You can use the configurable property to enable/disable notification
        inMsg.Context.Promote("AckRequired","http://schemas.microsoft.com/BizTalk/2003/system-properties",true);
        return inMsg;
    }

    Then create a send port with filter BTS.AckType == “ACK” to send the Acknowlegment through e-mail.

    In this way you don’t need to create any extra orchestration and e-mail address can be changed easily as and when required on send port.


    Please mark the post answered your question as answer, and mark other helpful posts as helpful, it'll help other users who are visiting your thread for the similar problem, Regards -Rohit Sharma (http://rohitbiztalk.blogspot.com)

    4 martie 2012 20:51
    Moderator
  • Hi,

    You have met the requirement of sending an email when file is generated. You have think for yourself if solution is fit for purpose and easy to maintain i.e. changes to functionality of send email. You state you created a SMTP class with implementation of functionality and that it works. So in my opinion you have met requirement of end user. I would not look for alternatives. I assume you have made it dynamic in a sense that you can change the email address e.a. through configuration.

    HTH

    Steef-Jan Wiggers

    MVP & MCTS BizTalk Server 2010

    http://soa-thoughts.blogspot.com/ | @SteefJan

    If this answers your question please mark it accordingly


    BizTalk

    5 martie 2012 04:14
    Moderator