I was sending an email dynamically, from an orchestration.
I set up a nice payload message with all of these nicely distinguished fields, that contained the to/ from, subject and body of the email, so that other parts of my system could send an email, just by generating this message.
My message assignment shape had:
EmailSendMessage = EmailReceiveMessage;
EmailSendMessage(SMTP.EmailBodyText) = EmailReceiveMessage.Body;
EmailSendMessage(SMTP.CC) = EmailReceiveMessage.CopyTo;
EmailSendMessage(SMTP.From) = EmailReceiveMessage.From;
EmailSendMessage(SMTP.Subject) = EmailReceiveMessage.Subject;
EmailSendMessage(SMTP.MessagePartsAttachments) = 0;
EmailSendPort(Microsoft.XLANGs.BaseTypes.Address) = "mailto:" + EmailReceiveMessage.SendTo;
The message itself was not sent, just the properties of this message, so the message I was constructing as receive message didn’t matter, so I made it the same type of the EmailReceiveMessage. It compiled, and I deployed it.
First Try:
Event Type: Error
Event Source: BizTalk Server 2009
Event Category: (1)
Event ID: 5754
Date: 13/12/2011
Time: 1:16:31 PM
User: N/A
Computer: [computer]
Description:
A message sent to adapter "SMTP" on send port "XXX.Email.Orchestrations_1.0.0.0_XXX.Email.Orchestrations.SendEmail_EmailSendPort_43e93d0db20c465a" with URI "mailto:email@address.com" is suspended.
Error details: Unknown Error Description
MessageId: {B66F52BA-DFF0-4274-B4B2-3B1F51E862E0}
InstanceID: {C7A4CA9E-E606-4D04-9001-D34974B4D971}
For more information, see Help and Support Center at http://go.microsoft.com/fwlink/events.asp.
I then checked and you needed to have the body text charset:
EmailSendMessage(SMTP.EmailBodyTextCharset) = "UTF-8";
Second try, same error…
Several modifications later I get the message: Unknown Error Description
Which I must say is not a great deal of use when you are trying to figure out what’s wrong.
I then decided I’d make a different message type for sending, and used a transform. I used my send message and copied and pasted the schema, I changed the target name space of course.
SAME ERROR…..
I was annoyed, and tried a bunch of things, then EUREAKA! …
The send schema which I copied and pasted has the same properties promoted as distinguished fields.
This was BAD it seems, the instant I removed these properties from being promoted, and changing nothing else… everything worked….
BAD BAD BAD... schema properties, who would have thought…
DO NOT HAVE PROMOTED PROPERTIES ON YOUR SCHEMA WHEN SENDING TO THE SMTP ADAPTER.
Monday, December 12, 2011
Subscribe to:
Posts (Atom)