|
dev
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
Net.Mail attachmentsI need to attach a file to an email. This is the file:
HttpPostedFile f = ResumeUpload.PostedFile; Stream i = f.InputStream; string buf = i.EndRead(); How can I attach this file directly from memory without writing it to disk first? -- Arne Garvander (I program VB.Net for fun and C# to get paid.) if you have the Stream, why dont you just attach it ???
NetMail.Attachments.Add(New System.Net.Mail.Attachment(i, New Net.Mime.ContentType("WHAT_MIME_YOU_WANT"))) -- Show quoteBruno Alexandre Strøby, Danmark "a Portuguese in Denmark" "Arne" <A***@discussions.microsoft.com> wrote in message news:E97F3AA5-1508-476D-812E-0444C3B106DB@microsoft.com... >I need to attach a file to an email. This is the file: > HttpPostedFile f = ResumeUpload.PostedFile; > Stream i = f.InputStream; > string buf = i.EndRead(); > How can I attach this file directly from memory without writing it to disk > first? > > -- > Arne Garvander > (I program VB.Net for fun and C# to get paid.) Tack.
-- Show quoteArne Garvander (I program VB.Net for fun and C# to get paid.) "Bruno Alexandre" wrote: > > if you have the Stream, why dont you just attach it ??? > > > NetMail.Attachments.Add(New System.Net.Mail.Attachment(i, New > Net.Mime.ContentType("WHAT_MIME_YOU_WANT"))) > > -- > > Bruno Alexandre > Strøby, Danmark > > "a Portuguese in Denmark" > > > "Arne" <A***@discussions.microsoft.com> wrote in message > news:E97F3AA5-1508-476D-812E-0444C3B106DB@microsoft.com... > >I need to attach a file to an email. This is the file: > > HttpPostedFile f = ResumeUpload.PostedFile; > > Stream i = f.InputStream; > > string buf = i.EndRead(); > > How can I attach this file directly from memory without writing it to disk > > first? > > > > -- > > Arne Garvander > > (I program VB.Net for fun and C# to get paid.) > it's "tak" ;-)
-- Show quoteBruno Alexandre Strøby, Danmark "a Portuguese in Denmark" "Arne" <A***@discussions.microsoft.com> wrote in message news:2F74633F-955D-4253-B6F6-39368779E1ED@microsoft.com... > Tack. > -- > Arne Garvander > (I program VB.Net for fun and C# to get paid.) > > > "Bruno Alexandre" wrote: > >> >> if you have the Stream, why dont you just attach it ??? >> >> >> NetMail.Attachments.Add(New System.Net.Mail.Attachment(i, New >> Net.Mime.ContentType("WHAT_MIME_YOU_WANT"))) >> >> -- >> >> Bruno Alexandre >> Strøby, Danmark >> >> "a Portuguese in Denmark" >> >> >> "Arne" <A***@discussions.microsoft.com> wrote in message >> news:E97F3AA5-1508-476D-812E-0444C3B106DB@microsoft.com... >> >I need to attach a file to an email. This is the file: >> > HttpPostedFile f = ResumeUpload.PostedFile; >> > Stream i = f.InputStream; >> > string buf = i.EndRead(); >> > How can I attach this file directly from memory without writing it to >> > disk >> > first? >> > >> > -- >> > Arne Garvander >> > (I program VB.Net for fun and C# to get paid.) >> |
|||||||||||||||||||||||