0

I want to query database and then send those records in an email.

For sending email I am using c# code.

After querying the data from Table I am writing the data in a csv file. Before sending the csv file as attachment I have to saving the csv file on disk.

Is there any way to send the attachment without saving the csv on disk?

Gurpreet Kailey
  • 567
  • 9
  • 26
  • 4
    Keeping your CSV file in memory and not saving it should do the Trick. But we need to see your code of how you are generating the CSV file, saving it and attaching it to your email. Without that code we can't help you further – MindSwipe Oct 01 '19 at 08:29
  • This answers your question https://stackoverflow.com/questions/5336239/attach-a-file-from-memorystream-to-a-mailmessage-in-c-sharp – Soumen Mukherjee Oct 01 '19 at 08:30

0 Answers0