Email attachment from InputStream?

  • Thread starter Thread starter steven shingler
  • Start date Start date
S

steven shingler

Hi all
I've figured out how to add an attachment to a MailMessage object from
a physical file on the hard disk, but would very much like to be able
to do this using an InputStream instead. This could be particularly
useful handling a PostedFile from a WebForm.
Has anyone got any ideas on this?
Best Wishes
Steven
 
The MailAttachment class sadly only allows for physical files. So your only
option is to save a file (convert the stream to a file) and then attach that
file.
 
Back
Top