【发布时间】:2014-11-03 08:06:55
【问题描述】:
由于以下错误,我无法通过表单发送电子邮件。我认为由于 CDO 被贬低,该表格不起作用?我不确定,但我也不确定如何解决这个问题。
CDO.Message.1 错误“80040220” “SendUsing”配置值无效。 /thankyou.asp,第 24 行
代码
<%
Set objMail = Server.CreateObject("CDO.Message")
objMail.Configuration.Fields("http://schemas.microsoft.com/cdo/configuration/sendusing") = 2
objMail.Configuration.Fields("http://schemas.microsoft.com/cdo/configuration/smtpserver") = "localhost"
objMail.Configuration.Fields("http://schemas.microsoft.com/cdo/configuration/smtpserverport") = 25
objMail.Configuration.Fields.Update
objMail.From = Request.Form("Email") ' change this to an email address
objMail.To = "admin@domain.com" ' change this to your email address
objMail.Subject = "name Questions/Comments" ' change this to your subject
'Set the e-mail body format (HTMLBody=HTML TextBody=Plain)
'Set the e-mail body format (HTMLBody=HTML TextBody=Plain)
objMail.HTMLBody = "<font size=3 face=verdana>"
objMail.HTMLBody = objMail.HTMLBody & "<strong>" & "From: " & "</strong>" & Request.form("Name") & "<br>"
objMail.HTMLBody = objMail.HTMLBody & "<strong>" & "Email: " & "</strong>" & Request.Form("Email") & "<br>"
objMail.HTMLBody = objMail.HTMLBody & "<strong>" & "Phone: " & "</strong>" & Request.Form("Phone") & "<br>" & "<br>"
objMail.HTMLBody = objMail.HTMLBody & "<strong>" & "Questions/Comments: " & "</strong>" & "<br>" & Replace(Request.Form("Details"), vbCrLf, "<br />") & "<br>" & "<br>" & "</font>"
'objMail.HTMLBody = objMail.HTMLBody & "<em>" & "Sent at " & Now() & "</em>" & "</font>"
objMail.Send()
Set objMail = Nothing*
%>
我无权访问物理服务器,也无法自行更改权限。
任何想法如何修复这段代码以使其再次工作?
我试过这个:http://forums.iis.net/t/1146477.aspx?The+SendUsing+configuration+value+is+invalid+
将 SendUsing 更改为 1。
并设置 google snmp 以发送电子邮件而没有太多结果。任何信息都会有所帮助。
【问题讨论】:
-
看看这个帖子我认为你缺少一个配置。字段msdn.microsoft.com/en-us/library/ms873037%28EXCHG.65%29.aspx
-
DJ,我在字段 "objMessage.Configuration.Fields.Item("schemas.microsoft.com/cdo/configuration/smtpserverport") = 25" 时遇到同样的错误
-
如果您使用的是 gmail smtp 服务器,那么您应该使用端口 587 而不是 25 您还需要在配置字段中提供用户名和密码paulsadowski.com/wsh/cdo.htm
标签: forms email asp-classic