这与我2017年的问题有关:How Set Attachment Name to Show Properly in Outlook
这一次,我在构造形状中配置了以下内容:
attachmentName = System.IO.Path.GetFileName(
msg_Ledger6002_File_XmlDoc
(FILE.ReceivedFileName));
msg_Email.BodyPart = new ABC.Ledger6002.Component.RawString("See attached email.");
msg_Email.AttachmentPart = msg_Ledger6002_File_XmlDoc;
// attachmentName is set earlier in orch so we could write it to EventLog for debugging
msg_Email.AttachmentPart(MIME.FileName) = attachmentName;
//msg_Email.AttachmentPart(MIME.ContentDescription) = "body";
//msg_Email.AttachmentPart(MIME.ContentTransferEncoding) = "base64";
// These are working
msg_Email(SMTP.Subject) = "Ledger6002 File";
msg_Email(SMTP.SMTPTo) = msg_Config_Email.smtpToEmail;
msg_Email(SMTP.From) = msg_Config_Email.smtpFromEmail;
msg_Email(SMTP.SMTPAuthenticate) = 0; // do not authenticate to SMTP server
// trying these two new parms below
msg_Email(SMTP.EmailBodyTextCharset) = "UTF-8";
msg_Email(Microsoft.XLANGs.BaseTypes.ContentType) = "text/plain";
上面的最后一行给出了一个表达式形状无效,当我鼠标对它时,它说将错误标识为:
Microsoft.XLANGs.BaseType.Content必须是msg_email的消息属性。
在我在评论“尝试下面这两个新的部分”下添加这两行之前,我收到了一封带有所需附件的电子邮件。问题是它只是被称为"body“,当我从Outlook中”保存为“时,它想称它为"body”,而不是我删除的文件的名称。
我正在为管道使用静态配置的SendPort和PassThru。我用MimeEncoder尝试了一条管道,但这导致附件出现在身体中。我想移到动态管道,但到目前为止,除了分配给文件附件的名称之外,静态管道还在工作。
发布于 2020-12-24 14:44:05
要修复错误:"Microsoft.XLANGs.BaseType.Content必须是msg_email的消息属性。“,我只需要包含部件名称(消息与多部分消息类型相关联,并且没有包含部分名称):
错误:
msg_Email(Microsoft.XLANGs.BaseTypes.ContentType) = "text/plain";
右侧:
msg_Email.BodyPart (Microsoft.XLANGs.BaseTypes.ContentType) = "text/plain";
我仍在努力让这封带有附件的电子邮件正确发布,但到目前为止,这篇文章https://social.msdn.microsoft.com/Forums/en-US/988b0d91-1e5a-4f73-b30d-417d6ea9fa75/attachment-name-in-outlook-is-ok-see-on-exchange-always-named-body?forum=biztalkgeneral似乎是最好的解释。
https://stackoverflow.com/questions/65432371
复制相似问题