How to attach a file from MemoryStream to a Mail in C#
How to attach a file from MemoryStream to a Mail in C#
Here's a simplified snippet for sending an in-memory string as an email attachment (a CSV file in this particular case). If you are trying this with PDF, put special mention on stream.position = 0. As it will make the writer write the file from starting position always. Whatever the source-type you care coming with convert that to memory-stream and the use the memory stream to create the…
View On WordPress



















