Indy.Sockets.TIdNetMemoryStream

Giganews Newsgroups
Subject: Indy.Sockets.TIdNetMemoryStream
Posted by:  antonioVS (aferra…@uniplan.it)
Date: Mon, 9 Oct 2006

Hi,
I have retrived POP3 mail with this code:

        Dim xMsg As Message = New Message
        xPOP3.Retrieve(IdMsg, xMsg)

        Dim body As String = ""
        Dim MP As Indy.Sockets.Text = xMsg.MessageParts(1)
        body = MP.Body.GetText
        For x As Integer = 1 To xMsg.MessageParts.Count - 1

            Dim att As Indy.Sockets.Attachment
            Dim isAtt As Boolean = False
            Try
                att = CType(xMsg.MessageParts.Items(x), Indy.Sockets.Attachment)
                isAtt = True
            Catch
            End Try

            Dim ct As String = xMsg.MessageParts.Items(x).ContentType
            If isAtt Then      'ct = "application/octet-stream" Then
                Dim stream As New Indy.Sockets.TIdNetMemoryStream
                att.SaveToStream(stream)

            End If

        Next

I put the attachment in stream, but I'm not be able to view or save the file in an asp.net page.

Somebody can help me?

Thanks.

Antonio.

Replies