CDOSYS and Japanese Email

A

Avram Grossman

I am using the classic examples from MSDN on CDOSYS and need to send a
message body formatted with HTML and contains Japanese characters. The body
tag in the HTML sets the character encoding using < meta
http-equiv="Content-Type" content="text/html; charset=iso-2022-jp" >. The
received message encoding is in Western ISO, not iso-2022-jp and therefore
not viewed in Japanese. If you switch the browser to display japanese
encoding, the message is displayed in Japanese just fine.

I've tried every combination and permutation I can find.
------------------------------------------------------------------
Function SendCDOSYS(sTo, sFrom, sCC, sSubject, sMessage)
Dim iConf
Dim iMsg
Dim Flds
Set iConf = CreateObject("CDO.Configuration")
Set iMsg = CreateObject("CDO.Message")
Set Flds = iConf.Fields
Flds(cdoSendUsingMethod) = cdoSendUsingPort
Flds(cdoSMTPServer) = "mail.MyEmailServer.com"
Flds(cdoSMTPServerPort) = 25
Flds(cdoSMTPAuthenticate) = cdoAnonymous ' 0
Flds(cdoLanguageCode).Value = "JA" 'This line seems to not make a
difference
Flds.Update

With iMsg
Set .Configuration = iConf
.MimeFormatted = true
.AutoGenerateTextBody = True
' Build Message Header
.To = sTo
.From = "(e-mail address removed)"
.Subject = sSubject
' Build Message content
.HTMLBody = sMessage
If InStr(sMessage,"shift_jis") > 0 OR InStr(sMessage,"iso-2022-jp")
.BodyPart.Charset = "iso-2022-jp"
.HTMLBodyPart.Charset = "iso-2022-jp"
End If
.Send
End With

Set iMsg = Nothing
Set iConf = Nothing
Set Flds = Nothing
Set IBodyPart = Nothing
SendCDO = true
End Function
 
A

Avram Grossman

I found a or the "fix." Instead of setting .HTMLBodyPart.Charset =
"iso-2022-jp", I set

..TextBodyPart.Charset = "iso-2022-jp". This works. I presume because setting
the .AutoGenerateTextBody = True will create the HTMLMessage from the
TextMessage encoding.

Now, how do I set the .subject to encode/display in Japanese????

- Avram Grossman
 
A

Activator8

Don't expect Outlook2000 to display a Japanese subject line. There is
a bug that prevents it from display correctly though I can't reference
a particular artical explaining it. Were you able to find any
resources on sending Japanese email correctly.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top