经典ASP,在windows server 2008上发送电子邮件-错误“8004020f”

时间:2022-04-27 04:45:23

I am trying to send e-mail with classic ASP (I am stuck with an old app so I have to use classic ASP here) on Windows Server 2008 R2, IIS 7.5.

我试图用经典的ASP发送电子邮件(我被一个旧的应用卡住了,所以我必须在Windows Server 2008 R2上使用经典的ASP), IIS 7.5。

I guess lots of thing change from win server 2003 to 2008. I am using the following code but I am getting this error (BTW, error message is so "informative");

我猜从2003年到2008年,很多事情都发生了变化。我正在使用下面的代码,但是我得到了这个错误(顺便说一下,错误消息是如此“有用”);

error '8004020f'

错误的8004020 f '

/poo.asp, line 32

/粪便。asp,第32行

Here is the code;

这是代码;

<!-- 
    METADATA 
    TYPE="typelib" 
    UUID="CD000000-8B95-11D1-82DB-00C04FB1625D"  
    NAME="CDO for Windows 2000 Library" 
-->  
<%  

    'Declare variables 
    Dim sch, cdoConfig, cdoMessage
    sch = "http://schemas.microsoft.com/cdo/configuration/" 

    Set cdoConfig = CreateObject("CDO.Configuration")  

    With cdoConfig.Fields  
        .Item(cdoSendUsingMethod) = cdoSendUsingPort  
        .Item(cdoSMTPServer) = "mail.example.com"
        'Set SMTP port which is 25 by default 
        .Item(sch & "smtpserverport") = 587 
        .Update  
    End With 

    Set cdoMessage = CreateObject("CDO.Message")  

    With cdoMessage 
        Set .Configuration = cdoConfig 
        .From = "info@example.com" 
        .To = "me@example2.com" 
        .Subject = "Sample CDO Message" 
        .TextBody = "This is a test for CDO.message" 
        .Send 
    End With 

    Set cdoMessage = Nothing  
    Set cdoConfig = Nothing  

Response.write "<HTML><head><title>A message has been sent.</title></head><body>A message has been sent.</body></HTML>"

%>

Also, I just installed Microsoft Exchange Server MAPI Client and Collaboration Data Objects 1.2.1 from http://www.microsoft.com/download/en/details.aspx?displaylang=en&id=1004 into my server but it didn't change anything.

另外,我刚刚在http://www.microsoft.com/download/en/details.aspx?上安装了Microsoft Exchange Server MAPI客户端和协作数据对象。displaylang=en&id=1004到我的服务器,但它没有改变任何东西。

NOTE: I could send e-mail over localhost if it works. doesn't matter.

注意:如果它有效,我可以通过localhost发送电子邮件。没关系。

1 个解决方案

#1


4  

You might come across the following error:

您可能会遇到以下错误:

error '8004020f' The event class for this subscription is in an

错误'8004020f'这个订阅的事件类是在一个。

invalid partition

无效的分区

This error message comes from cdosys.h, and has nothing to do with any sort of "partition" - it is actually lumped in with other errors in an overloaded message. The error code is actually attributed to the following:

这个错误消息来自cdosys。h,与任何类型的“分区”没有任何关系——它实际上是在一个重载的消息中与其他错误合并在一起的。错误代码实际上是由以下原因造成的:

CONST LONG CDO_E_RECIPIENTS_REJECTED = 0x8004020FL

Which means that the e-mail was rejected by the server for some reason. Here are some things you can try to alleviate the problem:

这意味着电子邮件由于某种原因被服务器拒绝了。以下是一些可以缓解问题的方法:

  1. Make sure the SMTP server allows anonymous (non-authenticated) relaying. If your SMTP requires outgoing authentication, see Article #2026.

    确保SMTP服务器允许匿名(未经身份验证)的转发。如果您的SMTP需要传出身份验证,请参见第2026条。

  2. Check if the problem is specific to the domain name(s) used in the e-mail addresses of the recipients. For example, some users have complained that they can send to users on their own domain only; others have said that they can send to any domain except their own (see Article #2511 for some potential causes and solutions).

    检查问题是否针对收件人电子邮件地址中使用的域名。例如,一些用户抱怨他们只能在自己的域中发送给用户;其他人则表示,他们可以发送到除自己以外的任何领域(一些潜在原因和解决方案参见第2511条)。

  3. It may be simply that the e-mail address is being rejected, but other configuration settings on the SMTP server are preventing the true error message from being relayed propely back to the ASP script ... so verify that the address is valid.

    可能只是电子邮件地址被拒绝了,但是SMTP服务器上的其他配置设置阻止了真正的错误消息被转发到ASP脚本……因此验证该地址是否有效。

  4. If you have a proxy or firewall, make sure the web server is set up to correctly pass through it, that the SMTP server knows about it, and that the proxy allows access to port 25.

    如果您有一个代理或防火墙,请确保web服务器被设置为正确地通过它,SMTP服务器知道它,并且代理允许访问端口25。

  5. Try using a SendUsing value of 1 (pickup) instead of 2 (port). E.g. the following line:

    尝试使用1(拾取)而不是2(端口)的senduse值。如以下行:

    .Item(cdoSendUsingMethod) = cdoSendUsingPort
    

Becomes

就变成了

.Item(cdoSendUsingMethod) = cdoSendUsingPickup

http://classicasp.aspfaq.com/email/why-does-cdo-message-give-me-8004020f-errors.html

http://classicasp.aspfaq.com/email/why - - cdo -信息-给我- 8004020 f - errors.html

#1


4  

You might come across the following error:

您可能会遇到以下错误:

error '8004020f' The event class for this subscription is in an

错误'8004020f'这个订阅的事件类是在一个。

invalid partition

无效的分区

This error message comes from cdosys.h, and has nothing to do with any sort of "partition" - it is actually lumped in with other errors in an overloaded message. The error code is actually attributed to the following:

这个错误消息来自cdosys。h,与任何类型的“分区”没有任何关系——它实际上是在一个重载的消息中与其他错误合并在一起的。错误代码实际上是由以下原因造成的:

CONST LONG CDO_E_RECIPIENTS_REJECTED = 0x8004020FL

Which means that the e-mail was rejected by the server for some reason. Here are some things you can try to alleviate the problem:

这意味着电子邮件由于某种原因被服务器拒绝了。以下是一些可以缓解问题的方法:

  1. Make sure the SMTP server allows anonymous (non-authenticated) relaying. If your SMTP requires outgoing authentication, see Article #2026.

    确保SMTP服务器允许匿名(未经身份验证)的转发。如果您的SMTP需要传出身份验证,请参见第2026条。

  2. Check if the problem is specific to the domain name(s) used in the e-mail addresses of the recipients. For example, some users have complained that they can send to users on their own domain only; others have said that they can send to any domain except their own (see Article #2511 for some potential causes and solutions).

    检查问题是否针对收件人电子邮件地址中使用的域名。例如,一些用户抱怨他们只能在自己的域中发送给用户;其他人则表示,他们可以发送到除自己以外的任何领域(一些潜在原因和解决方案参见第2511条)。

  3. It may be simply that the e-mail address is being rejected, but other configuration settings on the SMTP server are preventing the true error message from being relayed propely back to the ASP script ... so verify that the address is valid.

    可能只是电子邮件地址被拒绝了,但是SMTP服务器上的其他配置设置阻止了真正的错误消息被转发到ASP脚本……因此验证该地址是否有效。

  4. If you have a proxy or firewall, make sure the web server is set up to correctly pass through it, that the SMTP server knows about it, and that the proxy allows access to port 25.

    如果您有一个代理或防火墙,请确保web服务器被设置为正确地通过它,SMTP服务器知道它,并且代理允许访问端口25。

  5. Try using a SendUsing value of 1 (pickup) instead of 2 (port). E.g. the following line:

    尝试使用1(拾取)而不是2(端口)的senduse值。如以下行:

    .Item(cdoSendUsingMethod) = cdoSendUsingPort
    

Becomes

就变成了

.Item(cdoSendUsingMethod) = cdoSendUsingPickup

http://classicasp.aspfaq.com/email/why-does-cdo-message-give-me-8004020f-errors.html

http://classicasp.aspfaq.com/email/why - - cdo -信息-给我- 8004020 f - errors.html