在经典 ASP 中使用 HTMLBody(使用 TextBody 没问题)时出现 CDOSYS 错误

发布于 2024-12-10 02:31:01 字数 882 浏览 6 评论 0原文

我在 IIS 7.5 上使用带有 HTMLBody 的 CDOSYS 时遇到问题
简单地说,这不起作用:

Set Mail = CreateObject("CDO.Message")
With Mail
    .Subject = "My mail test"
    .From = "me@localhost"
    .To = "[email protected]"
    .HTMLBody = "My body message"
    .Configuration.Fields.Item("http://schemas.microsoft.com/cdo/configuration/sendusing") = 2
    .Configuration.Fields.Item("http://schemas.microsoft.com/cdo/configuration/smtpserver") = "localhost"
    .Configuration.Fields.Update
    .Send
End With
Set Mail = Nothing

并在行抛出一个神秘的“CDO.Message.1错误'80040605'未知错误”

.HTMLBody = "My body message"

如果我用请更改它没有问题

.TextBody = "My body message"

,你有解决方案吗?
提前致谢

I have a problem with CDOSYS with HTMLBody on IIS 7.5
Simply, this doesn't work:

Set Mail = CreateObject("CDO.Message")
With Mail
    .Subject = "My mail test"
    .From = "me@localhost"
    .To = "[email protected]"
    .HTMLBody = "My body message"
    .Configuration.Fields.Item("http://schemas.microsoft.com/cdo/configuration/sendusing") = 2
    .Configuration.Fields.Item("http://schemas.microsoft.com/cdo/configuration/smtpserver") = "localhost"
    .Configuration.Fields.Update
    .Send
End With
Set Mail = Nothing

And throws a misterious "CDO.Message.1 error '80040605' Unknown Error" at line

.HTMLBody = "My body message"

No problem if I change it with

.TextBody = "My body message"

Please, have you got a solution for this?
Thanks in advance

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

水晶透心 2024-12-17 02:31:01

找到了某种解决方案,尽管它并不理想。 CDO 应该能够自动生成 HTMLBody 的纯文本版本,但也许最近的 MS 更新已经破坏了它。

看起来,以前我可以省略 TextBody 属性,而只指定 HTMLBody,现在我必须执行以下两件事之一:

a) 指定 TextBody。 TextBody = "" 不起作用,它必须是 > ""

b) 指定 AutoGenerateTextBody = False

执行上述任一操作都可以解决错误,但会导致没有纯文本版本,或者必须自己制作,这很糟糕。不知道这个问题是什么时候开始的,但据我所知,过去可以单独指定 HTMLBody,没有问题。当当。

Found some kind of solution, though it's not ideal. CDO is supposed to be able to automatically generate the text-only version of your HTMLBody, but perhaps a recent MS update has broken it.

It seems that, where previously I could omit the TextBody property, and just specify HTMLBody, now I have to do either of these two things:

a) Specify TextBody. TextBody = "" does not work, it has to be > ""

b) Specify AutoGenerateTextBody = False

Doing either of those things gets around the error, but results in either no text-only version, or having to make it oneself, which sucks. No idea when this problem began, but afaik one used to be able to specify HTMLBody alone, without a problem. Dang.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文