怎样将pdf文件添加到email的附件当中
http://localhost/*****/*****.aspx?Report=IPECConItemLabel&A=4.7&B=5.7&C=199.6&D=0&E=143.5&F=0&G=0&H=0&Cols=1&Rows=2&FPC=2G3503&ID=8609487&ConID=ByID&Skip=0&UseZebra=No',%20'',%20'height=600,width=600,status=no,易做图=no,menubar=no,location=no,scrollbars=yes,resizable=yes'上面这个url会显示pdf文件在IE里面,请问怎样才能将这个pdf文件添加到email的附件当中。我想将文件写入MemoryStream
object(不想把文件存入临时文件夹), 然后用System.Net.Mail.Attachment。不知道怎样实现。谢谢。
--------------------编程问答-------------------- MailMessage.Attachments --------------------编程问答-------------------- 我知道用MailMessage.Attachments。 问题是怎样才能将那个online的pdf文件写入到stream object中 --------------------编程问答-------------------- 在线的pdf文件,在html文件里发送地址就可以了
发送文件应该下载下来,再使用
MailMessage message = new MailMessage();
message.From = new MailAddres;
message.Subject = "";
message.Body = "";
ContentType contentType = new ContentType(MediaTypeNames.Application.Pdf);
Attachment attachment = new Attachment(stream, contentType);
ContentDisposition disposition = attachment.ContentDisposition;
disposition.FileName = "1.pdf ";
message.Attachments.Add(attachment);
--------------------编程问答-------------------- Attachment attachment = new Attachment(stream, contentType)
请问这个stream是在哪里声明的亚?
补充:.NET技术 , ASP.NET