Quantcast
Channel: Chilkat Forum - latest questions
Viewing all articles
Browse latest Browse all 1061

Duplicated body content after v9.5.0.69

$
0
0

Howdy,

After v9.5.0.69 email on destination get duplicated content, this didn't happend in previous version. my code is as follows. is it a bug or something that needs any fine tuning?

' The mailman object is used for sending and receiving email. Dim mailman As New Chilkat.MailMan mailman.UnlockComponent("DEgggggggggggggggggg_oB8i")

    mailman.SmtpHost = SmtpHost
    mailman.SmtpPort = SmtpPort
    Select Case SmtpSecurity
        Case ""
        Case "ssl"
            mailman.SmtpSsl = True
        Case "tls"
            mailman.StartTLS = True
    End Select
    If SmtpAuth Then
        mailman.SmtpUsername = SmtpUser
        mailman.SmtpPassword = SmtpPass
    End If

    '  Create a new email object
    Dim email As New Chilkat.Email()

    email.Subject = EmailSubject
    '  The equals character is encoded as =3D in quoted-printable.
    '  If the encoding is truly 8bit, we won't see it in the MIME source
    '  of the email.  Instead, we'll see the equals character unmodified.
    email.Body = EmailBody
    email.FromName = EmailFromName
    email.FromAddress = EmailFromEmail
    'email.From =  "Chilkat Support <support@chilkatsoft.com>"
    email.Charset = "utf-8"

    ' read receipt
    If ReadReceipt Then
        email.ReturnReceipt = True
    End If
    If DSNNotify Then
        mailman.DsnNotify = "SUCCESS" ',FAILURE,NOTIFY"
        mailman.DsnRet = "FULL" ' "HDRS"
    End If

    email.AddHeaderField("X-Emailer", "Client v97.69")

    Try
        email.AddMultipleTo(EmailMultipleTO)
    Catch ex As Exception
        'MsgBox(ex.Message & vbCrLf & "Erro no formato dos emails do para.")
        'Exit Function
    End Try
    Try
        email.AddMultipleCC(EmailMultipleCC)
    Catch ex As Exception
        'MsgBox(ex.Message & vbCrLf & "Erro no formato dos emails do CC.")
        'Exit Function
    End Try
    Try
        email.AddMultipleBcc(EmailMultipleBCC)
    Catch ex As Exception
        'MsgBox(ex.Message & vbCrLf & "Erro no formato dos emails do BCC.")
        'Exit Function
    End Try

    ' fazer isto um array, onde no array tem o path dos files, no fim fazer o destroy
    Try
        For i As Int32 = 0 To Attachments.Length - 1
            email.AddFileAttachment(Attachments(i))
        Next
    Catch ex As Exception
    End Try

    Dim htmlemail As String = String.Empty
    htmlemail = "<html>"
    htmlemail &= "<body>"
    htmlemail &= "<p>"
    htmlemail &= EmailBody.Replace(vbCrLf, "<br>").Replace(vbCr, "<br>")

    htmlemail &= "</p>"
    htmlemail &= "</body>"
    htmlemail &= "</html>"

    email.SetHtmlBody(htmlemail)
    htmlemail = String.Empty

    '  Set our content-transfer-encoding to 8bit:
    '  The AddHeaderField will replace the header field if it
    '  already exists.
    email.AddHeaderField("content-transfer-encoding", "8bit")

    '  That's it... send the email and the HTML and/or plain-text body
    '  will not be encoded using quoted-printable or base64 -- it
    '  will instead be sent unencoded as 8-bit characters.

    If Not mailman.SendEmail(email) Then
        result = "ERRO: " & mailman.LastErrorText
    Else
        result = "OK"
    End If

    email.Dispose()
    email = Nothing
    mailman.Dispose()
    mailman = Nothing

Viewing all articles
Browse latest Browse all 1061

Trending Articles