Attachment attachResource = new Attachment(Server.MapPath("/public/_pdf/" + strFILEGUID + ".pdf")); mail.Attachments.Add(attachResource);
System.IO.MemoryStream data = new System.IO.MemoryStream(); System.IO.Stream str = File.OpenRead(Server.MapPath("/public/_pdf/" + strFILEGUID + ".pdf")); str.CopyTo(data); data.Seek(0, SeekOrigin.Begin); byte[] buf = new byte[data.Length]; data.Read(buf, 0, buf.Length); Attachment attachResource = new Attachment(data, "ChangedFileName" + ".pdf"); mail.Attachments.Add(attachResource);
System.IO.BinaryReader bw = new BinaryReader(str); byte[] buf = bw.ReadBytes((int)str.Length);
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)