views:

115

answers:

1

I've got the code below, and I'm trying to set the from field to allow unicode. Currently in my email client I get "??".

The subject line and any content shows the unicode correctly. And looking at the MSDN the property should be "urn:schemas:httpmail:from".

Anyone solved this issue?

Thanks

M

Dim AC_EMAIL : AC_EMAIL = "[email protected]"

Dim AC_EMAIL_FROM : AC_EMAIL_FROM = "测试 <[email protected]>"

Dim strSubject : strSubject = """测试"" testing testing"

set oMessage = WScript.CreateObject("CDO.Message")

With oMessage

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

    .Fields("urn:schemas:httpmail:from") = AC_EMAIL_FROM

    .Fields("urn:schemas:httpmail:to") = AC_EMAIL

    .Fields("urn:schemas:httpmail:subject") = strSubject

    .Fields.Update

    .Send

End With

Set oMessage = Nothing
A: 

Found a work around. Not the prettiest, but it works. Basically I converted the string to Quoted-Printable.

.Fields("urn:schemas:httpmail:from") = "=?utf-8?Q?=E6=8F?= <[email protected]>"
Simmo