Dynamically add XML as an attatchment from Stream

Discussion in 'ASP .Net' started by UnglueD, Oct 4, 2006.

  1. UnglueD

    UnglueD Guest

    Hello.

    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
    encountered.

    Initially I have done this:

    If orderErrors.count > 0 Then
    w = New StreamWriter(orderFile)
    s.Serialize(w, orderErrors)
    w.Close()
    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!!
     
    UnglueD, Oct 4, 2006
    #1
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. =?Utf-8?B?TmlrbGFz?=

    Use DIME/attatchment to download an application

    =?Utf-8?B?TmlrbGFz?=, Aug 10, 2004, in forum: ASP .Net
    Replies:
    0
    Views:
    866
    =?Utf-8?B?TmlrbGFz?=
    Aug 10, 2004
  2. Rasmusson, Lars
    Replies:
    1
    Views:
    782
    popov
    Apr 30, 2004
  3. Replies:
    9
    Views:
    670
    Alex Buell
    Apr 27, 2006
  4. Martin
    Replies:
    6
    Views:
    548
    Patrice
    Aug 3, 2007
  5. Niklas

    Use DIME/attatchment to download an application

    Niklas, Aug 10, 2004, in forum: ASP .Net Web Services
    Replies:
    0
    Views:
    106
    Niklas
    Aug 10, 2004
Loading...

Share This Page