CDO.Message编码问题 [英] CDO.Message encoding issue
本文介绍了CDO.Message编码问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我们当前正在将邮件传递系统更改为仅使用UTF-8
.
We're currently changing our mail delivery system to use solely UTF-8
.
当电子邮件包含非ASCII字符(希伯来语)时,发件人名称似乎有问题.正文可以正常显示,但发件人名称(显示在我的gmail帐户中)变为-??????
.
There seems to be a problem with the sender name, when the email contains non ASCII chars (hebrew) the subject & body render ok, but the sender name, as it appears in my gmail account, becomes - ??????
.
有一行代码:
myMail.BodyPart.Charset = "UTF-8"
所以我认为应该有一些类似的代码:
So I thought there should be some code of the like:
myMail.SenderName.Charset = "UTF-8"
但是,假设这样做可以解决问题,我似乎找不到合适的代码.
But I can't seem to find the right code to use, assuming this would do the trick.
推荐答案
这对我有用: http://www.powerasp.net/content/new/sending_email_cdosys.asp
Dim ObjSendMail
Set ObjSendMail = CreateObject("CDO.Message")
ObjSendMail.Configuration.Fields.Item ("http://schemas.microsoft.com/cdo/configuration/sendusing") = 2
ObjSendMail.Configuration.Fields.Item ("http://schemas.microsoft.com/cdo/configuration/smtpserver") = "myserver"
ObjSendMail.Configuration.Fields.Item ("http://schemas.microsoft.com/cdo/configuration/smtpserverport") = 25
ObjSendMail.Configuration.Fields.Item ("http://schemas.microsoft.com/cdo/configuration/smtpusessl") = False
ObjSendMail.Configuration.Fields.Item ("http://schemas.microsoft.com/cdo/configuration/smtpconnectiontimeout") = 60
ObjSendMail.Configuration.Fields.Update
ObjSendMail.To = to_email
ObjSendMail.Subject = subject
ObjSendMail.From = from_email
'ObjSendMail.TextBody = mensaje 'tipo texto
ObjSendMail.HTMLBody = mensaje 'tipo html
ObjSendMail.TextBodyPart.Charset = "utf-8" 'support symbols á ñ ¡
ObjSendMail.Send
Set ObjSendMail = Nothing
这篇关于CDO.Message编码问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文