Windows Server - Sending named attachments to email messages
Asked By Idar
27-Jun-07 02:14 AM

Hi,
I have an orchestration where I have defined a dyamic send port, and I want
to use this port to send an XML document by the SMTP adapter. The code I use
to configure the send port in an Expression in the orchestration is somethin
like this:
SendDynamicMessagePort(Microsoft.XLANGs.BaseTypes.Address) = @"mailto:" +
inMessage(Markedsregulering.PropertySchema.Address);
sendOrder(SMTP.Subject) = "Incoming order";
sendOrder(SMTP.Username) =
inMessage(Markedsregulering.PropertySchema.Address);
sendOrder(SMTP.EmailBodyTextCharset) = "UTF-8";
sendOrder(SMTP.EmailBodyText) = "\nA message is enclosed to this email\n";
sendOrder(SMTP.MessagePartsAttachments) = 1;
This works fine, and the attachment gets the name body.xml.
The receiver of this message want me to name the attachment where the name
is dynamically created based on a couple of elements in the document, i.e.
exped_123456.xml where exped and 123456 is retrieved from the document.
Does anyone knows how I can name the attachment of the email?
Thanks
--
Thanks,
Idar
Microsoft.XLANGs.BaseTypes.Address
(1)
SMTP.EmailBodyTextCharset
(1)
SMTP.MessagePartsAttachments
(1)
SMTP.EmailBodyText
(1)
Markedsregulering.PropertySchema.Address
(1)
MIME.FileName
(1)
SMTP.Username
(1)
SMTP.Subject
(1)
saravanam replied...
This link will help you
http://www.winterdom.com/weblog/2006/07/27/SettingAttachmentFilenameWithTheSMTPAdapter.aspx
--
Regards,
Saravana Kumar
http://www.biztalk247.com/v1/
http://www.digitaldeposit.net/blog
[Please mark the response as "Answer" if it solves your problem.]
Idar replied...
The example says:
EMail.OriginalMessage(MIME.FileName) = "OriginalMessage.xml";
In the example below, SendDynamicMessagePort is a dynamic send port, and the
message is sendOrder. In the BizTalk Expression Editor, I get "illegal dotted
name" when I try to write sendOrder.OriginalMessage(MIME.FileName) = ...
I guess I get the message because of the dynamic send port, but what am I
doing wrong?
--
Thanks,
Idar
saravanam replied...
You need to define your message (sendOrder) as Multipart message.
This link will show you how to define and use multipart message
http://msdn.microsoft.com/msdnmag/issues/07/05/BizTalk/default.aspx#S1
I just create a quick sample, my expression shape has the following lines
Message_3.MessagePart_1(MIME.FileName)
Step1:
1. Right Click on "Multi-part Message Type" in the orchestration view
(bottom types window) and click new message (Default Name: MultipartType_1)
2. Expand the tree node, click on "MessagePart_1" (Default part name) and
assign corresponding schema
3. In the orchestration view created a message called "Message_3" and
assigned the Message Type to "BizTalk_Server_Project3.MultipartType_1"
You need to do the same.
--
Regards,
Saravana Kumar
http://www.biztalk247.com/v1/
http://www.digitaldeposit.net/blog
[Please mark the response as "Answer" if it solves your problem.]
I generated a send_pipline, the necessary schema . . . . here is my code / / Mail Message erzeugen SendMailPort(Microsoft.XLANGs.BaseTypes.Address) = "mailto:" + Response.Email; emaildummy.LoadXml (@"<ns0:emailMessage xmlns:ns0 = ""http: / / DILL_VERSION2.email""> <emailbody> emailbody_0< / emailbody Name: "+ Response.Name + " Kosten: " + System.Convert.ToString(Response.Summe)+ " €" ; email(SMTP.Subject) = "Rechnung"; email(SMTP.EmailBodyTextCharset) = "ISO-8859-1"; email(SMTP.EmailBodyText) = "x"; email(SMTP.From) = "admin@myorg.com"; email(SMTP.SMTPHost) = "server01.myorg.com"; - -- -- -- -- -- -- -- -- -- -- -- -- -- -- - In my
file directory 2. A construct message with Message assignment shape and the following expressions: SendEmail_Port(Microsoft.XLANGs.BaseTypes.Address) = RequestAlert_Msg.mailto; SendEmail_Msg = RequestAlert_Msg; SendEmail_Msg(SMTP.SMTPHost) = "myhost"; SendEmail_Msg(SMTP.Subject) = "Test"; SendEmail_Msg(SMTP.From) = "Suma"; SendEmail_Msg(SMTP.EmailBodyText) = RequestAlert_Msg.Keywords; SendEmail_Msg(SMTP.EmailBodyTextCharset) = "utf-8"; SendEmail_Msg(SMTP.EmailBodyFileCharset) = "utf-8"; SendEmail_Msg(SMTP.MessagePartsAttachments) = 2; That's all. I
orchestration the same way that I do setting up the ftp address. Like this FTPXMLfile(Microsoft.XLANGs.BaseTypes.Address) = Filename + ".xml"; MydataXML(FTP.UserName) = UserName; MydataXML(FTP.Password) = Password; thumbprint = "96 1d 96 27 is totally wrong, please send me a code that works. Regards Geir F BizTalk Discussions Microsoft.XLANGs.BaseTypes.Address (1) DAIntegrator.Lovdata.Pipelines.LovdataFlatfilPipe (1) FTPXMLfile (1) FTPFlatfil (1) MydataXML (1) RTFDoc (1) Database
port I can specify the URI of the target endpoint in an orchestration using the Microsoft.XLANGs.BaseTypes.Address property. My understanding is that this is resolved to a physical adapter using the transport value to one of the above values? Thanks BizTalk Discussions Microsoft.XLANGs.BaseTypes.TransportType (1) Microsoft.XLANGs.BaseTypes.Address (1) BizTalk Server 2006 R2 (1) BizTalk (1) WCF (1) WSHttp (1) Mihai (1) Adapters
hi, i have a dynamic request-response SAP port configured in an expression shape: Port_DynamicSAP(Microsoft.XLANGs.BaseTypes.Address) = sap: / / user = {0};passwd = {1};Client = 800;lang = DE@AS / {2} / 00; Port_DynamicSAP(Microsoft.XLANGs who can help me with this problem? thx. . BizTalk Discussions Microsoft.XLANGs.BaseTypes.TransportType (1) Microsoft.XLANGs.BaseTypes.Address (1) SapSend.Username (1) DynamicSAP (1) MyERP (1) Newsbeitrag (1) Biztalk (1) Passwd (1) ok