Stream as an Attachment to System.Net.Mail is 0 bytes

后端 未结 2 1092
温柔的废话
温柔的废话 2021-02-02 13:54

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

2条回答
  •  不思量自难忘°
    2021-02-02 14:56

    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

    1. Use the stream to create a file on disk

    2. Attach the file to an email

    3. Delete the file when done with it.

提交回复
热议问题