【发布时间】:2023-03-22 01:02:01
【问题描述】:
伙计们,
使用System.Diagnostics.Process.Start("mailto:创建邮件的方法,有没有办法给邮件添加动态附件(不是保存的文件)?
我和question 中的这个人几乎一样,但没有人使用 mailto: 方法回答。 我只是想知道它是否可能,以及如何做到这一点。
我试过了,但没有用:
System.IO.MemoryStream ms = new System.IO.MemoryStream(generatedReport.DocumentBytes);
System.Net.Mime.ContentType ct = new System.Net.Mime.ContentType(System.Net.Mime.MediaTypeNames.Application.Pdf);
Attachment attachment = new Attachment(ms, ct);
attachment.ContentDisposition.FileName = "output.pdf";
System.Diagnostics.Process.Start("mailto:myemail &SUBJECT=Test Subject BODY=Body Text&Attachment=" + attachment);
ms.Close();
感谢您的任何帮助
【问题讨论】:
-
好的,谢谢,回到我的绘图板
标签: c# .net winforms mailmessage