CDOSYS and Unicode in the from field - vbScript.

Posted by Simmo on Stack Overflow See other posts from Stack Overflow or by Simmo
Published on 2010-03-05T13:00:02Z Indexed on 2010/04/01 15:43 UTC
Read the original article Hit count: 377

Filed under:
|
|
|
|

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

© Stack Overflow or respective owner

Related posts about vbscript

Related posts about cdo