【问题标题】:Why when I'm sending emails with CDO in Classic ASP I get ñ instead of ñ?为什么当我在 Classic ASP 中使用 CDO 发送电子邮件时,我得到 ñ 而不是 ñ?
【发布时间】:2015-04-30 16:02:38
【问题描述】:

我在 IIS 8.5 和 Windows 8.1 中使用 CDO 在 Classic ASP 中发送电子邮件时遇到问题,问题发生在拉丁字符上,例如 ñ áéíóúü 等。例如,如果我将 ñ 放在主题和/或正文中我得到了ñ。

这是我的代码:

Set objConfig = Server.CreateObject("CDO.Configuration")
Set Fields = objConfig.Fields

With Fields
 .Item("http://schemas.microsoft.com/cdo/configuration/sendusing")      = 2 
 .Item("http://schemas.microsoft.com/cdo/configuration/smtpserver")     = "smtp.gmail.com"
 .Item("http://schemas.microsoft.com/cdo/configuration/smtpserverport") = 465
 .Item("http://schemas.microsoft.com/cdo/configuration/sendusername")   = "email@gmail.com"
 .Item("http://schemas.microsoft.com/cdo/configuration/sendpassword")   = "the-pwd-123"
 .Item("http://schemas.microsoft.com/cdo/configuration/smtpusessl")     = true
 .Item("http://schemas.microsoft.com/cdo/configuration/smtpauthenticate")   = 1

 .Update
End With

Set objMessage = Server.CreateObject("CDO.Message")

Set objMessage.Configuration = objConfig

With objMessage
 .BodyPart.Charset = "utf-8"
 '.BodyPart.Charset = "unicode-1-1-utf-8"
 .To       = "<email@gmail.com>"
 .From     = "<email2@gmail.com>"
 .Subject  = "Envio de contraseña"
 .TextBody = "This email has a ñ to see how it looks when sending email through CDO"
 .Send
End With

邮箱的配置是UTF8,那么问题出在哪里呢,请问如何解决呢?

【问题讨论】:

    标签: email utf-8 asp-classic cdo.message iis-8.5


    【解决方案1】:
    猜你喜欢
    • 2013-10-03
    • 1970-01-01
    • 2021-03-01
    • 2011-07-12
    • 1970-01-01
    • 1970-01-01
    • 2016-05-02
    • 2016-05-22
    • 1970-01-01
    相关资源
    最近更新 更多