【发布时间】:2014-03-09 18:44:55
【问题描述】:
每次我发送表单时都会出现这个错误:Object required: 'objCDOSYSCon'
我尝试过改变一些事情。我已经为用户名和密码输入了正确的信息。我已经检查了两次。我已尽我所能让它发挥作用。
非常感谢您的帮助。
这是我的 ASP 代码:
<!-- #INCLUDE FILE="function.asp" -->
<%
if not isempty(request.form("MembershipSignUp")) then
FirstName=required(request.form("FirstName"),"First Name")
LastName=required(request.form("LastName"),"Last Name")
BillToAddress=request.form("BillToAddress")
City=required(request.form("City"),"City")
Quebec=request.form("Quebec")
PostalCode=required(request.form("PostalCode"),"Postal Code")
Phone=required(request.form("Phone"),"Phone")
CellPhone=required(request.form("CellPhone"),"CellPhone")
MembershipLevel=required(request.form("MembershipLevel"),"Membership Level")
SpecialInsterests=required(request.form("SpecialInsterests"),"Special Insterests")
Announcements=request.form("Announcements")
mailto="kelsey.boyd@hotmail.ca"
subject=Firstname&" "&Lastname&" wants to sign up for a membership"
body="First Name:" &firstname&"<br>Last Name:"&lastname&"<br>Bill To Address:"&BillToAddress&"<br>City: "&City&"<br>Quebec: "&Quebec&"<br>Postal Code: "&PostalCode&"<br>Phone: "&Phone&"<br>Cell Phone:"&CellPhone&"<br>Membership Level:"&MembershipLevel&"<br>Special Insterests:"&SpecialInsterests&"<br>Announcements:"&Announcements
call mailit()
response.redirect "www.google.ca"
end if
if not isempty(request.form("MembershipSignUpHomePage")) then
Name=required(request.form("Name"),"Name")
Email=required(request.form("Email"),"Email")
mailto="kboyd@itm.com"
subject=Name&" wants to sign up for the newsletter"
.TextBody="Name:" &Name&"<br>Email:"&Email
call mailit()
response.redirect "www.google.ca"
end if
sub mailit()
Set cdoConfig = CreateObject("CDO.Configuration")
With cdoConfig.Fields
.Item("http://schemas.microsoft.com/cdo/configuration/sendusing") = 2
.Item("http://schemas.microsoft.com/cdo/configuration/smtpserver") = "localhost"
'Your UserID on the SMTP server'
objCDOSYSCon.Fields.Item("http://schemas.microsoft.com/cdo/configuration/sendusername") = "Info@domain.ca"
'Your password on the SMTP server'
objCDOSYSCon.Fields.Item("http://schemas.microsoft.com/cdo/configuration/sendpassword") = "password"
.Update
End With
Set cdoMessage = CreateObject("CDO.Message")
With cdoMessage
Set .Configuration = cdoConfig
.From = "info@seniorsactionquebec.ca"
.To = "info@seniorsactionquebec.ca"
.Subject = "TEST MCW"
.TextBody = "This is a test for CDO.message"
.Send
End With
Set cdoMessage = Nothing
end sub
%>
【问题讨论】:
标签: php asp.net forms asp-classic