错误 '8004020f' /poo.asp, line 32
以下是代码:
<!--
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>"
%>
此外,我刚刚从http://www.microsoft.com/download/en/details.aspx?displaylang=en&id=1004下载并安装了Microsoft Exchange Server MAPI Client and Collaboration Data Objects 1.2.1,但没有改变任何东西。 注意:如果本地主机可以工作,则可以发送电子邮件。