Reputation: 55
Here is my situation:
- I receive an XML which contains an email address in the field (ie [email protected]). - This XML is then mapped to a CSV (The Email is not mapped to the CSV and it does not contain this email address). - I then need to send this CSV as an attachment to the email which was contained in the original XML.
What I have done before is sent email through an SMTP adapter and used a custom pipeline component to attach a file to an email. BUT, the reason I am not going into depth about how hard I have tried to figure this out, and all my code etc... is because with the company I am working for I am unable to access an SMTP server on my desktop. I can only deploy solutions and test the SMTP functionality on a test server (i cannot develop them/debug etc on the test server), which has basically made this particular project a massive headache. So I have tried a few things, but continuing I feel, without some help is a lost cause.
Can someone please point me in the right direction, or the steps I should take (code would be amazing), the objects I might need in an orchestration, or anything that would help me?
Thanks so much for your help in advance.
Upvotes: 3
Views: 1250
Reputation: 11947
A few things that I think could make you life a bit easier.
Promote the email address field in the incoming message using a promoted property schema. This way you'll have the email address available later on.
Map the incoming message to a CSV format on the send port (you should map to your destination-format as late as possible in the process).
Create a pipeline component that sets the following properties on you message. Make sure to create you component in a way that you can configure these properties run-time. Use the BizTalk Pipeline Component Wizard tool. The important properties are:
Set the address to send to using you previously promoted property.
Use for example the Antrix SMTP Server for developers app. This will basically snatch any messages sent to an SMTP server and store the files in a litte tray app. Nice while developing and testing.
Upvotes: 1