Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > Dynamically add XML as an attatchment from Stream

Thread Tools

Dynamically add XML as an attatchment from Stream

Posts: n/a

I've written an application that sends an email when complete. I
wish to attach an XML document with any custom errors that the program

Initially I have done this:

If orderErrors.count > 0 Then
w = New StreamWriter(orderFile)
s.Serialize(w, orderErrors)
mail.Attachments.Add(New Attachment(orderFile))
End If

Where orderErrors is an Object which contains an XML serializable
array of error messages. It serializes fine and I have gotten it to
output to an absolute path on the filesystem. Then I attatch it to the
email to be sent.

What I would like to do is skip outputing it to an actual XML file on
the filesystem, and serialize it to a stream (which the Attatchments
framework allows) and send it.

I wish to do this because, I wish to publish just the .exe and have
it be used on different machines who will not have this directory
structure setup.

Thanks in advance!!

Reply With Quote

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Content-Disposition attatchment question Martin ASP .Net 6 08-03-2007 02:16 PM
Use DIME/attatchment to download an application =?Utf-8?B?TmlrbGFz?= ASP .Net 0 08-10-2004 06:35 AM
Outlook Express attatchment problems ak Computer Support 3 05-25-2004 07:17 AM
Attatchment Pete & Jean Computer Support 2 11-02-2003 04:11 PM
OE removed an unsafe attatchment in my e-mail Andrew Mott Computer Support 13 09-02-2003 10:09 PM