CDO mail in Unicode

F

Frank.

I have Chinese website form using script to send email. How do I set CDO to
set mail in Unicode?
Thank you.
 
D

David Berry

See http://support.microsoft.com/default.aspx/kb/810702

<snip>

Send Unicode message text
This example includes a Unicode character (the Euro symbol, ?, Unicode code
point 0x20ac) in the display name of the recipient and in the message text.
In both examples, "?" is encoded into the utf-7 CharSet property. CDONTS
must use the CP_UTF7=65000 constant. For CDOSYS, the CharSet name is
unicode-1-1-utf-7.
CDONTS example
Set s = CreateObject("CDONTS.Session") S.LogonSMTP "User 1",
"(e-mail address removed)" s.SetLocaleIDs 65000 ' cpUTF7 Set m =
s.Outbox.Messages.Add
m.MessageFormat = 0 ' CdoMime set r = m.Recipients.Add 'r.address =
"(e-mail address removed)" r.name = "Joe ?" r.address = "<[email protected]>"
m.Subject = "Unicode content" m.Text = "That will be ?5, please."
m.SendCDOSYS example
set m =
CreateObject("CDO.Message") m.From = "User1 <[email protected]>" m.To =
"Joe ? <[email protected]>" m.Subject = "Unicode content" set b =
m.bodypart b.charset = "unicode-1-1-utf-7" m.textbody = "That will be ?5,
please." m.send



</snip>
 

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