from 字段中的 CDOSYS 和 Unicode
我有下面的代码,我正在尝试将 from 字段设置为允许 Unicode。目前在我的电子邮件客户端中我收到“??”。
主题行和任何内容都正确显示 Unicode。查看 MSDN,该属性应该是 "urn:schemas:httpmail:from"
。
有人解决了这个问题吗?
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
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?
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
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
找到了解决方法。不是最漂亮的,但它有效。基本上我将字符串转换为 Quoted-Printable。
Found a work around. Not the prettiest, but it works. Basically I converted the string to Quoted-Printable.