ASP邮件错误:此订阅的事件类在无效的分区中 [英] ASP Mail Error: The event class for this subscription is in an invalid partition

查看:78
本文介绍了ASP邮件错误:此订阅的事件类在无效的分区中的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一些从我的前任继承"来的ASP代码(不,目前不能选择对其进行更新...这不仅需要国会采取行动,而且其他所有国家也都必须采取) ),并且在其中一个页面上发送邮件时遇到问题.这是与另一页几乎相同的代码段,但是当我尝试发送"时,该代码段将引发错误.

I have some ASP code that I've "inherited" from my predecessor (no, it's not an option to update it at this time...It would take an act of not only Congress, but every other foreign country too) and I'm having an issue sending mail on one of the pages. It is an almost identical code snippet from the other page, but this one throws an error when I try to 'Send'.

以下代码:

Set myMail=CreateObject("CDO.Message")
myMail.Configuration.Fields.Item("http://schemas.microsoft.com/cdo/configuration/sendusing")=2

'Name or IP of remote SMTP server
myMail.Configuration.Fields.Item("http://schemas.microsoft.com/cdo/configuration/smtpserver")="localhost"

'Server port
myMail.Configuration.Fields.Item("http://schemas.microsoft.com/cdo/configuration/smtpserverport")=25 
myMail.Configuration.Fields.Update

myMail.Subject="Subject"
myMail.From=from_email
myMail.To=email
myMail.TextBody= "Body Text of message"
myMail.Send

抛出的错误是: 错误类型: (0x8004020F) 此订阅的事件类在无效的分区中

The error thrown is: Error Type: (0x8004020F) The event class for this subscription is in an invalid partition

我将不胜感激!

谢谢! 合资企业

推荐答案

我在尝试使CDO正常工作时遇到了类似的问题.我在此网站上找到了很酷的文章为什么CDO.Message给我8004020F错误?

这是我终于开始工作的代码.我永远无法让localhost充当SMTP服务器.找出邮件服务器的名称是什么,并确保使用该名称.

I had similar issues trying to get CDO to work. I found a really cool article on this website Why does CDO.Message give me 8004020F errors?

Here is the code I finally got to work. I could never get localhost to work as the SMTP Server. Find out what the name of the mail server is and make sure to use that name.

<!--METADATA TYPE="typelib" UUID="CD000000-8B95-11D1-82DB-00C04FB1625D" NAME="CDO for Windows 2000 Type Library" -->
<!--METADATA TYPE="typelib" UUID="00000205-0000-0010-8000-00AA006D2EA4" NAME="ADODB Type Library" -->
<%
Set cdoConfig = CreateObject("CDO.Configuration")

With cdoConfig.Fields
        .Item(cdoSendUsingMethod) = cdoSendUsingPort
        .Item(cdoSMTPServer) = "nameofmailservergoeshere"
        .Update
End With


Set cdoMessage = CreateObject("CDO.Message")

With cdoMessage
        Set .Configuration = cdoConfig
        .From = "me@mywebsite.com"
        .To = "you@yourwebsite.com"
        .Subject = "Sample CDO Message"
        .TextBody = "This is a a test message using CDO."
        .Send
End With

Set cdoMessage = Nothing
Set cdoConfig = Nothing
%>

这篇关于ASP邮件错误:此订阅的事件类在无效的分区中的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆