Home Page › Forums › BizTalk 2004 – BizTalk 2010 › Can I make BizTalk ignore an invalid email attachment such as an image as part of a senders signature file? › Re: Can I make BizTalk ignore an invalid email attachment such as an image as part of a senders signature file?
I guess you have an orchestration in your solution – if no create one. Inside the orchestration define a variable with type Microsoft.XLANGs.BaseTypes.XLANGMessage and assign the incoming email message to this variable. You can refer to each part of the email (e.g. body, attachments) with expression "varableName[1]", "variableName[2]" etc. Now you have access to various properties of each email part, for example the file name of the attachment is <variable_holding_actual_message_part>.GetPartProperty(typeof(MIME.FileName)) – note that this method returns Object type. And thus you are in the finish line as you can check file extension and based on that decide what to do…