|
| I'm using the SMTP adapter to send an email with an attachment. In testing,
I was able to send a nice, plain text message... and I'm able to send an
attachment; but when setting it up to do both - that's when it breaks.
For some goofy reason, both the attachment (zip, pdf, what ever) and the
body text of the email are being sent as attachments.
I do have my multi-part message set up as such...
Multi-part Message Types
.... EmailOutMessage
.... ... EmailAttachment
.... ... EmailText
EmailAttachment is of type System.Xml.XmlDocument
EmailText is of type Microsoft.XLANGs.CustomFormattersSDK.RawString
Here's the code that I've put into the MessageAssignment shape:
// Set email body text here...
EmailOut.EmailText = new
Microsoft.XLANGs.CustomFormattersSDK.RawString.RawString("This is a test
message. Your report is attached");
// Set the attachment here...
EmailOut.EmailAttachment = PDFIn;
// Set the Context Type...
SMTPUtils.Part.SetContentType(EmailOut.EmailText, "text/html");
//set the content type for the attachment
SMTPUtils.Part.SetContentType(EmailOut.EmailAttachment,"text/xml");
// Change the attachment filename to something useful...
SMTPUtils.Part.SetFileName(EmailOut.EmailAttachment, filename);
// Set email subject here...
EmailOut(SMTP.Subject) = "Message from BizTalk SMTP Adapter";
// Set dynamic port email address value...
Port_2(Microsoft.XLANGs.BaseTypes.Address) = "mailto:" +
EmailData2.EmailAddress;
AND.... I have a send pipeline set up using the MIME/SMIME encoder. The
"Send body part as attachment" is set to "False"
Everything looks right (according to the samples I've seen)... any ideas???
MarkS
|
|