Special Characters & MIME

I am using the folowing code to generate HTML which is mailed via SMTP. The generation of the code causes all the special characters to be replaced with odd character combinations. How can I change the code or other settings to keep my special characters?

Dim session As New NotesSession

session.ConvertMIME = False ' Do not convert MIME to rich text



countAttach = 2



findArray (0) = "=3D"

findArray (1) = Chr(13)&Chr(10)

findArray (2) = "<img src=cid:"

findArray (3) = "=5F1="

findArray (4) = "= "

findArray (5) = "=EA"

findArray (6) = "=EB"

replArray (0) = Uchr$ ( Clng ( "&H" & Mid("=3D" , 2 ) ) )

replArray (1) = " "

replArray (2) = {<img src="http://} & Mid (db.Server,4 , Instr(db.Server , "/" ) - 4) & ".clover.co.za/" & db.FilePath & "/LookupKey"

replArray (3) = "/"

replArray (4) = ""

replArray (5) = "e"

replArray (6) = "e"



Set mime = doc.GetMIMEEntity("Article")



imageCount = 2



' Rendering of the Article item content to HTML

If Not(mime Is Nothing) Then

	strHTML = ""

	If mime.ContentType = "multipart" Then

		Set child = mime.GetFirstChildEntity

		While Not(child Is Nothing)

			If child.ContentSubType="html" Then

				strHTML =  strHTML +  child.ContentAsText

			End If

			Set child = child.GetNextSibling

		Wend

	Else 

		strHTML = mime.ContentAsText

	End If

Else 

End If

sourceArray (0) = strHTML

replHTML = Replace ( sourceArray , findArray , replArray )



replLen = Len ( Cstr ( replHTML (0)))	

finalHTML = ""

For i = 1 To replLen

	If ( Mid ( replHTML (0) , i , 10 )  = "/LookupKey" )Then

		finalHTML = finalHTML + "/LookupKey/"+ doc.UniversalID + "/Article/M" + Cstr(imageCount) + {!OpenElement"}

		i = i + 44

		imageCount = imageCount + 1

	Else

		finalHTML = finalHTML + Mid ( replHTML (0) , i , 1)

	End If

Next

Subject: Special Characters & MIME

Hi,

the content of the mime entity is probably encoded in one ot the other way. So try a

Call child.DecodeContent()

before you do

strHTML = strHTML + child.ContentAsText

Had the same problem yesterday, and it worked.

Best regards
Mario Varchmin