5
iTextSharp-通过电子邮件附件发送内存中的pdf
我在这里问了几个问题,但仍然有问题。如果您能告诉我我在代码中做错了什么,我将不胜感激。我从ASP.Net页运行上面的代码,并得到“无法访问封闭的流”。 var doc = new Document(); MemoryStream memoryStream = new MemoryStream(); PdfWriter.GetInstance(doc, memoryStream); doc.Open(); doc.Add(new Paragraph("First Paragraph")); doc.Add(new Paragraph("Second Paragraph")); doc.Close(); //if I remove this line the email attachment is sent but with 0 bytes MailMessage mm = new MailMessage("username@gmail.com", "username@gmail.com") { Subject = "subject", IsBodyHtml = true, Body = …
100
c#
email
pdf
itextsharp