I\'ve got a project where I\'m using a PDF generator to send a file to a user. We\'d like to give the user the option to attach this file to an email instead, and we\'re having
A guess... Back dat stream up to the beginning before sending nit
// Set the position to the beginning of the stream.
stream.Seek(0, SeekOrigin.Begin);
mail.Attachments.Add(new Attachment(stream, "myPdf.pdf"));
mail.Send();
Have you tried saving the file and then attaching the file, rather than attempting to attach a stream?
added
The normal process here would be
Use the stream to create a file on disk
Attach the file to an email
Delete the file when done with it.