none
Dynamic SMTP problems RRS feed

  • Question

  • I have created a dynaic smtp port as follows....

     

    EmailInvoice = Invoice;

    EmailInfoPath(Microsoft.XLANGs.BaseTypes.Address) = "mailto:" + Invoice.Header.VendorEmail;

    EmailInvoice(SMTP.SMTPHost) = "localhost";

    EmailInvoice(SMTP.SMTPAuthenticate) = 1;

    EmailInvoice(SMTP.Username) = test@myhost;

    EmailInvoice(SMTP.Password) = "password";

    EmailInvoice(SMTP.From) = test@myhost;

    EmailInvoice(SMTP.Subject) = "Draft Invoice '" + Invoice.Header.VendorID + "-" + Invoice.Header.VendorRef + "'";

    EmailInvoice(SMTP.EmailBodyFileCharset) = "UTF-8";

    EmailInvoice(SMTP.EmailBodyText) = "The attached file contains a draft.... generated message.";

    EmailInvoice(MIME.FileName) = "Invoice-" + Invoice.Header.VendorID + "-" + Invoice.Header.VendorRef + ".xml";

    EmailInvoice(SMTP.MessagePartsAttachments) = 2;

    EmailInvoice(XMLNORM.ProcessingInstructionOption) = 1;

    EmailInvoice(XMLNORM.ProcessingInstruction) = "<?mso-infoPathSolution solutionVersion=\"1.0.0.20\" productVersion=\"12.0.0\" PIVersion=\"1.0.0.0\" href=\"file:///C:\\Invoice.xsn\" name=\"urnTongue Tiedchemas-microsoft-comSurpriseffice:infopath:Invoice:http---Schemas-Invoice\" ?><?mso-application progid=\"InfoPath.Document\"?>";

     

    The same parameters work perfectly on a static port but when I use the dynamic port, BizTalk suspends the message with "A failure was encountered while transmiting the message".

     

    The event log is just as unhelpful...

    A message sent to adapter "SMTP" on send port "Test.Orchestrations_1.0.0.0_test.Orchestrations.Outbound_Drafts_EmailInfoPath_9a19d22f9464af40" with URI mailtoStick out tongueartner1@myhost is suspended.

    Error details: Unknown Error Description

    MessageId: {20C6DA9A-651A-4E2B-9FC2-F9E355120F78}

    InstanceID: {B81D710D-A539-4CFF-BBB7-05CBD45A1E86

     

    How can I find out what the problem is ?

    Saturday, April 5, 2008 11:37 PM

Answers

  • Yes, the problem is solved, although I'm not sure what I had done wrong as I needed to rebuild the orchestration based on some new changes and the new dynamic port worked :-)

     

    In case it helps, here's the code for my port for emails with an attachment, 

     

    varEmailText = "Your invoice with reference " + varVendorRef + " was rejected by ***** with the error -" + System.Environment.NewLine + System.Environment.NewLine + " >>> " + varErrorMsg + " <<<" + System.Environment.NewLine + System.Environment.NewLine + "Please correct and resubmit.";

    EmailWithAttachment.BodyPart = new Microsoft.Samples.BizTalk.XlangCustomFormatters.RawString(varEmailText);

    EmailWithAttachment.BodyPart(Microsoft.XLANGs.BaseTypes.ContentType) = "text/plain";

    EmailWithAttachment.AttachmentPart = InfoPathInvoice;

    EmailWithAttachment.AttachmentPart(MIME.FileName) = varVendorRef + ".xml";

    EmailWithAttachment.AttachmentPart(Microsoft.XLANGs.BaseTypes.ContentType) = "text/xml";

    to_Vendor_with_attachment(Microsoft.XLANGs.BaseTypes.Address) = "mailto:" + varVendorEmail;

    EmailWithAttachment(SMTP.SMTPHost) = "********";

    EmailWithAttachment(SMTP.SMTPAuthenticate) = 1;

    EmailWithAttachment(SMTP.Username) = "****";

    EmailWithAttachment(SMTP.Password) = "********";

    EmailWithAttachment(SMTP.From) = "****@********";

    EmailWithAttachment(SMTP.Subject) = "Invoice: '" + varVendorRef + "' rejected - " + varErrorMsg ;

    EmailWithAttachment(SMTP.EmailBodyFileCharset) = "UTF-8";

    EmailWithAttachment(SMTP.MessagePartsAttachments) = 2;

     

    Friday, July 25, 2008 6:47 AM

All replies

  • Hi Richard,

     

    Did you ever happen to find the answer to your problem listed above (Dynamic SMTP Port Sending)? I'm having the exact same issue and could benefit from any resolution.

     

    Thanks!!

     

    Thursday, July 24, 2008 7:00 PM
  • Yes, the problem is solved, although I'm not sure what I had done wrong as I needed to rebuild the orchestration based on some new changes and the new dynamic port worked :-)

     

    In case it helps, here's the code for my port for emails with an attachment, 

     

    varEmailText = "Your invoice with reference " + varVendorRef + " was rejected by ***** with the error -" + System.Environment.NewLine + System.Environment.NewLine + " >>> " + varErrorMsg + " <<<" + System.Environment.NewLine + System.Environment.NewLine + "Please correct and resubmit.";

    EmailWithAttachment.BodyPart = new Microsoft.Samples.BizTalk.XlangCustomFormatters.RawString(varEmailText);

    EmailWithAttachment.BodyPart(Microsoft.XLANGs.BaseTypes.ContentType) = "text/plain";

    EmailWithAttachment.AttachmentPart = InfoPathInvoice;

    EmailWithAttachment.AttachmentPart(MIME.FileName) = varVendorRef + ".xml";

    EmailWithAttachment.AttachmentPart(Microsoft.XLANGs.BaseTypes.ContentType) = "text/xml";

    to_Vendor_with_attachment(Microsoft.XLANGs.BaseTypes.Address) = "mailto:" + varVendorEmail;

    EmailWithAttachment(SMTP.SMTPHost) = "********";

    EmailWithAttachment(SMTP.SMTPAuthenticate) = 1;

    EmailWithAttachment(SMTP.Username) = "****";

    EmailWithAttachment(SMTP.Password) = "********";

    EmailWithAttachment(SMTP.From) = "****@********";

    EmailWithAttachment(SMTP.Subject) = "Invoice: '" + varVendorRef + "' rejected - " + varErrorMsg ;

    EmailWithAttachment(SMTP.EmailBodyFileCharset) = "UTF-8";

    EmailWithAttachment(SMTP.MessagePartsAttachments) = 2;

     

    Friday, July 25, 2008 6:47 AM
  • I had the same dillema, but I found out that I can create static SMTP send ports, and then using Role Links, I could forward the message to the correct send port, instead of coding all of that SMTP stuff. I wrote about it here:

    http://blog.biztalk-info.com/archive/2008/06/19/BizTalk_Role_Links_explained.aspx

    and

    http://blog.biztalk-info.com/archive/2006/11/08/Role_Links_Session_2.aspx

     

    Hope this might help

    Eric

    http://biztalk-info.com

     

     

     

    Sunday, August 3, 2008 9:57 AM
  • Richard,

    do you mind sharing your solution? seems you created a multi-part message for the attachment stuff? can you show me how your XML looks like with all parts?

    and
    how did you build Microsoft.Samples.BizTalk.XlangCustomFormatters.RawString? i added reference to

    Microsoft.XLANGs.BaseTypes but on Microsoft.Samples.BizTalk.XlangCustomFormatters.RawString i'm still getting  "identifier "sample" doesnt exist in 'Microsoft'. are you missing a referencedassembly"

    Thursday, July 16, 2009 5:18 PM
  • I hit the same problem.

        msg_NotificationOutput(SMTP.EmailBodyText) = var_Message; // #1

         msg_NotificationOutput(SMTP.EmailBodyTextCharset) = "UTF-8"; // #2

    When I added line#2, this frustrating error disappeared.
    Error description is completely useless!

    Event Type:	Error
    Event Source:	BizTalk Server 2006
    Event Category:	BizTalk Server 2006 
    Event ID:	5754
    Date:		12/03/2010
    Time:		11:54:02 AM
    User:		N/A
    Computer:	********
    Description:
    A message sent to adapter "SMTP" on send port "*********" with URI "mailto:********.com" is suspended. 
     Error details: Unknown Error Description  
     MessageId:  {EF92DE61-C92F-48EA-8928-163D719123F2}
     InstanceID: {3B7009E0-4505-49DC-B323-BEC97286CBEC}
    
    

    Conclusion: If we use the SMTP.EmailBodyText property, we must set up the
    SMTP.EmailBodyTextCharset property.

    To me it looks like a bug in BizTalk. [Maybe it is "by design", but guys, plese, give us a usefull error text!!!]

    And don't ask me how much time I've spent with this investigation :\

    Leonid Ganeline [BizTalk MVP] Biztalkien blog
    • Proposed as answer by Ruth Resende Friday, April 20, 2012 1:17 PM
    Friday, March 12, 2010 8:28 PM
  • Leonid,

    I agree with you on the undescriptive error message, but the error is by the design as described here:
    http://msdn.microsoft.com/en-us/library/aa578155(BTS.20).aspx

    Although this documentation isn't clear either as it states :'If you don't set a value, you may see the error shown at the end of this topic. ', but there is no error at the end of the topic.

    Regards,

    René
    Sunday, March 14, 2010 1:49 PM
  • Thank you Rene to give a link to the source!
    Leonid Ganeline [BizTalk MVP] Biztalkien blog
    Monday, March 15, 2010 4:10 PM