PC Review


Reply
Thread Tools Rate Thread

CDOSYS and Japanese Email

 
 
Avram Grossman
Guest
Posts: n/a
 
      5th Apr 2004
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 Removed)"
.Subject = sSubject
' Build Message content
.HTMLBody = sMessage
If InStr(sMessage,"shift_jis") > 0 OR InStr(sMessage,"iso-2022-jp")
> 0 Then

.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
-----------------------------------------------------
What am I not doing right or missing?
Thanks



 
Reply With Quote
 
 
 
 
Avram Grossman
Guest
Posts: n/a
 
      6th Apr 2004
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

"Avram Grossman" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> 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 Removed)"
> .Subject = sSubject
> ' Build Message content
> .HTMLBody = sMessage
> If InStr(sMessage,"shift_jis") > 0 OR

InStr(sMessage,"iso-2022-jp")
> > 0 Then

> .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
> -----------------------------------------------------
> What am I not doing right or missing?
> Thanks
>
>
>



 
Reply With Quote
 
Activator8
Guest
Posts: n/a
 
      30th Apr 2004
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.

"Avram Grossman" <(E-Mail Removed)> wrote in message news:<(E-Mail Removed)>...
> 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
>
> "Avram Grossman" <(E-Mail Removed)> wrote in message
> news:(E-Mail Removed)...
> > 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 Removed)"
> > .Subject = sSubject
> > ' Build Message content
> > .HTMLBody = sMessage
> > If InStr(sMessage,"shift_jis") > 0 OR

> InStr(sMessage,"iso-2022-jp")
> > > 0 Then

> > .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
> > -----------------------------------------------------
> > What am I not doing right or missing?
> > Thanks
> >
> >
> >

 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Unable to send an email - cdosys.dll problem Akbur Microsoft ASP .NET 8 13th Apr 2007 03:04 PM
need help with CDOSYS Email authentication. Paul Microsoft Frontpage 1 28th Jan 2007 03:37 AM
Sending Email Using CDOSys from Windows 2003 Server =?Utf-8?B?TWl0Y2ggVw==?= Microsoft Dot NET 1 25th Mar 2006 03:11 PM
anyway to call cdosys email from within asp.net page? GJH Microsoft ASP .NET 3 2nd Feb 2006 12:55 AM
Scripting question - sending email using CDOSYS =?Utf-8?B?Q2FuZGFjZQ==?= Windows XP General 10 4th Nov 2005 02:49 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 04:11 PM.