Groups | Blog | Home
all groups > iis smtp nntp > february 2005 >

iis smtp nntp : CDOSYS Subject line in Unicode


Sam Carter
2/8/2005 11:51:03 AM
I'm unable to get unicode in the CDOSYS subject line. Here's my code...

<%@LANGUAGE="VBSCRIPT" CODEPAGE="65001"%>
<%

Sub SendMail (sFromAddress, sToAddress, sCcAddress, sBccAddress, sSubject,
sBody, boolReadReceipt, intImportance )
' on error resume next
Const cdoDispositionNotificationTo =
"urn:schemas:mailheader:disposition-notification-to"
Const cdoReturnReceiptTo = "urn:schemas:mailheader:return-receipt-to"
dim cdoMessage

Set cdoMessage = CreateObject("CDO.Message")
With cdoMessage

.BodyPart.charset = "utf-8" '"unicode-1-1-utf-8"

IF boolReadReceipt Then
.Fields(cdoDispositionNotificationTo) = sFromAddress
.Fields(cdoReturnReceiptTo) = sFromAddress
End If

' Set the Importance: 0:Low, 1:Normal, 2:High
.Fields("urn:schemas:httpmail:importance").Value = intImportance
.Fields.Item("urn:schemas:httpmail:subject") = sSubject
.Fields.Item("urn:schemas:httpmail:textdescription") = sBody
.Fields.Update
.From = "<support@learnsecuritywith.us>" & sFromAddress
.ReplyTo = sFromAddress
.To = sToAddress
.Cc = sCcAddress
.Bcc = sBccAddress
.Send
End With

Set cdoMessage = Nothing
Set cdoConfig = Nothing
End Sub

The email body works fine (rendering Japanese), but the subject renders
question marks ???? in Outlook - usually an indication that the subject
isn't encoded properly.

Having said this, I'm able to open a "new" email in Outlook, paste Japanese
in the email body, but not the Subject line.

Is this a problem with Outlook, Windows XP or CDOSYS?

Sam Carter
2/8/2005 12:04:18 PM
Reading the same email with Thunderbird instead of Outlook shows perfect
Subject line encoding.

What's up with Outlook?

AddThis Social Bookmark Button