Discussion:
Sending email with multiple binary attachments using BTS 2006
(too old to reply)
zee
2006-06-03 06:50:01 UTC
Permalink
I'm trying to send an email with multiple attachments from an orchestration
using a SMTP port in BTS 2006 using custom pipeline component with MIME
encoder. I got it to work where I get an email with multiple attachments but
the attachment data is corrupted for binary attachments (.exe or .doc etc).
The orchestration calls custom .Net code which creates and populates the
multiple parts with the attachment data. Here is the code snippet for
reference:

byte[] databytes = System.IO.File.ReadAllBytes(@"C:\notepad.exe");
MainMessage.AddPart(databytes, "Attachment1");
Microsoft.XLANGs.BaseTypes.XLANGPart part1 = message["Attachment1"];
part1.SetPartProperty(typeof(MIME.FileName), "t2.exe");

How can I get the binary attachments to work without them getting corrupt?
Any help on this would be appreciated.
WenJun Zhang[msft]
2006-06-05 09:32:20 UTC
Permalink
Hi,

Which type of content transfer encoding is used on the MIME/SMIME pipeline
component? Is it the default Base64? I think you should try attaching the
files directly(using Attachments property) instead of adding them as
message parts. Some information/reference may be helpful:

BizTalk 2006 - SMTP Updates
http://blogs.conchango.com/matthall/archive/2005/08/09/1975.aspx

SMTP Adapter Property Schema and Properties
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/bts06operat
ions/html/6d062fb6-d728-4525-8f0d-bd3f0f8ff7ca.asp

How to Configure the MIME/SMIME Encoder Pipeline Component
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/bts06develo
ping/html/dcbb08e8-d300-4e7f-9c1c-907fb602e721.asp

Also you may set 'Send body part as attachment' to true to have a try.

Best regards,

WenJun Zhang
Microsoft Online Partner Support

When responding to posts, please "Reply to Group" via your newsreader so
that others may learn and benefit from your issue.

This posting is provided "AS IS" with no warranties, and confers no rights.
zee
2006-06-07 22:29:01 UTC
Permalink
Thankyou for responding to my question and providing the useful links.

The encoding in use is the default base64 encoding on the pipeline. It seems
that BizTalk is sending the message part out as an XML as the attachment I
get in the email looks like this:

<?xml version="1.0"?>
<base64>0M8R4KGxGuEAAAAAAAAAAAA</base64>

How to indicate to BizTalk to treat the message part as a MIME message part
and not a XML message part? I'm sure it would work if I use the Attachments
property of the SMTP adapter, but I'm curious to know why it doesn't work
this way.

Any comments/suggestions would be appreciated.

Zee
Post by WenJun Zhang[msft]
Hi,
Which type of content transfer encoding is used on the MIME/SMIME pipeline
component? Is it the default Base64? I think you should try attaching the
files directly(using Attachments property) instead of adding them as
BizTalk 2006 - SMTP Updates
http://blogs.conchango.com/matthall/archive/2005/08/09/1975.aspx
SMTP Adapter Property Schema and Properties
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/bts06operat
ions/html/6d062fb6-d728-4525-8f0d-bd3f0f8ff7ca.asp
How to Configure the MIME/SMIME Encoder Pipeline Component
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/bts06develo
ping/html/dcbb08e8-d300-4e7f-9c1c-907fb602e721.asp
Also you may set 'Send body part as attachment' to true to have a try.
Best regards,
WenJun Zhang
Microsoft Online Partner Support
When responding to posts, please "Reply to Group" via your newsreader so
that others may learn and benefit from your issue.
This posting is provided "AS IS" with no warranties, and confers no rights
WenJun Zhang[msft]
2006-06-12 14:14:10 UTC
Permalink
Hi Zee,

I'd perform some further researching on how to make it work with message
parts. Please wait for my update. Thanks.

Best regards,

WenJun Zhang
Microsoft Online Partner Support

This posting is provided "AS IS" with no warranties, and confers no rights.
Loading...