Friday, September 16, 2011

Message as Mail Attachment?

How to send any message as a mail attachment?
  1. No need to create Multipart messages.
  2. No need to set any parameters.
Just set the Dynamic SendPort SMTP properties like.
UserName,Password,Hostname,To email address.
You can find more settings here

Important thing is using the Mime Encoder in the Send Pipeline if you want to send attachments.
It seems like I tried setting the property in Orchestration as
msgXmlDocumentOut(SMTP.MessagePartsAttachments) = 1;
It dint work.Finally I added the PipelineComponent and it worked fine. You can also set the FileName Overriding the Mime.FileName property as shown below.
public static void SetMimeFileName(Microsoft.XLANGs.BaseTypes.XLANGPart msgpart, string MimeFileName)
                msgpart.SetPartProperty(typeof(MIME.FileName), MimeFileName);

No comments:

Post a Comment