gpt4 book ai didi

encoding - CDO.Message 编码问题

转载 作者:行者123 更新时间:2023-12-04 13:10:32 26 4
gpt4 key购买 nike

我们目前正在更改我们的邮件递送系统以单独使用 UTF-8 .

发件人姓名似乎有问题,当电子邮件包含非 ASCII 字符(希伯来语)时,主题和正文可以正常显示,但发件人姓名在我的 gmail 帐户中显示为 - ?????? .

有一行代码:

myMail.BodyPart.Charset = "UTF-8"

所以我认为应该有一些类似的代码:
myMail.SenderName.Charset = "UTF-8"

但我似乎无法找到正确的代码来使用,假设这可以解决问题。

最佳答案

这对我有用: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

关于encoding - CDO.Message 编码问题,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/27420042/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com