CDOSYS和Unicode在from字段中 [英] CDOSYS and Unicode in the from field

查看:205
本文介绍了CDOSYS和Unicode在from字段中的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有下面的代码,我正在设置从字段允许Unicode。目前在我的电子邮件客户端,我得到??。

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 "??".

主题行和任何内容正确显示Unicode。查看MSDN,该属性应为urn:schemas:httpmail:from

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

任何人解决这个问题?

Dim AC_EMAIL : AC_EMAIL = "test@test.com"
Dim AC_EMAIL_FROM : AC_EMAIL_FROM = "测试 <test@test.com>"
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


推荐答案

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?= <test@test.com>"

这篇关于CDOSYS和Unicode在from字段中的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆