BizTalk 2013 SMTP Send Attachment File name as "body.<filename ext>" in Outlook 2016 client RRS feed

  • General discussion

  • Hi,

    I was working on one of client requirement to send BizTalk messages as attachment through SMTP with custom or dynamic file name at run time. 

    At first impression, I knew from my previous experience that, BizTalk require some custom coding into Orchestration (to create multi-part messages using RawString custom helper, etc.) or custom pipeline component to enrich MIME.FileName property at encoder stage of pipeline. So I developed pipeline component and write MIME file name property value as per my requirement and deployed all the artifacts for end to end testing. 

    Unfortunately, the file name does not appear as per my code or customization and always show "body.<filename ext>". I walked through many old blogs, URL or documents again to find out what causing this issue. All looks fine in my code as per blogs and articles. So I started different analysis of outlook client configuration , the reason for move focused on outlook client is, some of blogs were talking about attachment issue with latest version of office 365 or outlook but not concretely point of root cause or BizTalk. 

    1st step towards my finding of root cause, I found, when you try to save your attachment file to one drive or local physical drive you can see actual custom file name which pushed through BizTalk custom component. 

    To further narrate this issue cause, I configured my other email address which is configured to run under outlook 2013 client and send BizTalk message as attachment on this different email account. Surprisingly, I can see correct attachment file name on mail sent to this email account client. 

    So in summary, I found that, outlook 2016 client display MIME encoded file attachment name as "body.<file name ext>" always even though custom file name exist for attachment. 

    Please share your experience or input if you come across something new around this.


    Viral B. Mistry

    Monday, December 5, 2016 3:17 AM

All replies

  • We are having the same issue. Is there already an update/solution for this? 

    Thanks already!

    Wednesday, March 1, 2017 1:05 PM
  • Hi , 

    Try to assign the file name to the MIME.PartContentTypeSecondaryHeaderValue context property, too.



    Tuesday, May 23, 2017 7:51 AM
  • Construct shape (old code from BTS 2003 R2)

    msgEmail.MessagePart_Attachment = msgIn.MessagePart_Body;
    msgEmail.MessagePart_Body = new dk.lemu.biztalk.utilities.RawString(vBody);
    msgEmail.MessagePart_Body(Microsoft.XLANGs.BaseTypes.ContentType) = "text/html";
    msgEmail(SMTP.From) = "<from>";
    msgEmail(SMTP.CC) = "<cc>";
    System.Threading.Thread.CurrentThread.CurrentCulture = System.Globalization.CultureInfo.CreateSpecificCulture("da-DK");
    msgEmail(SMTP.Subject) = vSubject;
    System.Threading.Thread.CurrentThread.CurrentCulture = System.Threading.Thread.CurrentThread.CurrentCulture;
    msgEmail(SMTP.EmailBodyFileCharset) = "UTF-8";
    msgEmail(SMTP.MessagePartsAttachments) = 2; // Use the one marked as body part as body, the rest attached.
    msgEmail.MessagePart_Attachment(MIME.FileName) = vFileName;
    Port_send_Email(Microsoft.XLANGs.BaseTypes.Address) = "mailto:"+vEmail;

    hth  /Peter

    EDIT: Oh sorry missed your last paragraph 
    Tuesday, May 23, 2017 8:43 AM