Login  
Search All Forums
Dart Home | PowerTCP Mail for ActiveX | Custom Development Reply | PowerTCP Mail for ActiveX Topics | Forums   
AuthorForum: PowerTCP Mail for ActiveX
Topic: Need Help with Sending Attachments
tmckee

From: Irving, TX USA
Posts: 13
Member Since: 09/29/04
posted April 8, 2005 2:12 PM

I have set up a multipart/alternative MessageStream object that I use to send email. When the the email is delivered at the recipients end, the size of the email shows that the attachment has been sent, but I cannot retrieve. For example when the message is sent to Hotmail, I can view the email source and see the encoded attachment, but i cannot retrieve. I am running the latest version of the DLLs. Below I have provided a posting of the code that I am using to instantiate a MessageStream object and the code used to populate the information.

' Here I create the MessageStream object and set
' its From, To, ContentType, and MimeBoundary
' properties.
Dim mailData As New MessageStream
    mailData.Subject = subject
    mailData.From = New MailAddress(senderUserName & "@" & Me.m_Domain)
    mailData.To.Add(New MailAddress(recipientEmailAddress))
    mailData.Type = "multipart/alternative"
    mailData.MimeBoundary = _
      "=_UnLiKeLyCHARS3734"

    ' Set the text version of the email
    Dim textContent As New MessagePartStream
    textContent.ContentType = "text/plain"
    textContent.Text = textEmail
    mailData.Parts.Simple.Add(textContent)

    ' Set the HTML version of the email
    Dim htmlContent As New MessagePartStream
    htmlContent.ContentType = "text/html"
    htmlContent.Text = htmlEmail
    mailData.Parts.Simple.Add(htmlContent)

    ' Add each attachment
    If Not IsNothing(attachments) Then
      Dim attachment As Attachment
      For Each attachment In attachments
        Dim contentStream As New MemoryStream(attachment.Content)
        Dim attachmentStream As New MimeAttachmentStream( _
          contentStream, _
          attachment.FileName, _
          ContentType.AutoDetect, _
          ContentEncoding.Base64, _
          "" _
        )        
        mailData.Attachments.Add(attachmentStream)
      Next
    End If

Does anything seem amiss with the code above?
Tony Priest



From: Utica, NY USA
Posts: 8466
Member Since: 04/11/00
posted April 8, 2005 2:29 PM

This is kind of advanced for the forum. Please contact support@dart.com to find out about alternative support options.
tmckee

From: Irving, TX USA
Posts: 13
Member Since: 09/29/04
posted April 8, 2005 4:39 PM

Simpler question then. Do I have to use multipart/mixed to send an attachment or can I use multipart/alternative. The problem is that if I use multipart/mixed and I send html & text along with the attachment, the html and attachment are both delivered as attachments -- even on an html enabled mail client.

Thanks
Reply | PowerTCP Mail for ActiveX Topics | Forums   
This site is powered by PowerTCP WebServer Tool PowerTCP WebServer for ActiveX