SMTP 提供程序 C# 代码:
MailMessage Mail;
Mail.Attachments.Clear();
Byte[] bytes = System.Text.Encoding.ASCII.GetBytes(strICSData);
var ms = new MemoryStream(bytes);
var a = new Attachment(ms, "meeting111.ics", "text/calendar");
a.ContentDisposition.Inline = true;
Mail.Attachments.Add(a);
此处
a.ContentDisposition.Inline
获取或设置一个 System.Boolean 值,该值确定电子邮件附件的处置类型(内联或附件)。
上面的代码工作正常,并将我的会议映射到 Outlook 日历,如下所示。
发送邮件后查找 smtp 屏幕截图:
邮戳提供程序 C# 代码:
我也在使用邮戳提供商进行邮件,但我没有找到任何a.ContentDisposition.Inline = true;
功能。
请找到以下邮戳代码:
PostmarkMessage message;
message.Attachments.Clear();
byte[] bytes = System.Text.Encoding.ASCII.GetBytes(strICSData);
var ms = new MemoryStream(bytes);
message.AddAttachment(ms, "meeting111.ics", "text/calendar");
Below line, Adds a file stream with inline support:
message.AddAttachment(ms, "meeting.ics", "text/calendar");
任何人都可以为我提供解决方案,以便邮戳附件将映射到 Outlook 日历。