This is my very first post on Webmaster-Talk - sorry for the emotive title, but this problem is driving me crazy...
The following is an ASP script that someone recently did for me (it sends form data to an email address):
<%@ Language=VBScript %>
<html>
<head>
</head>
<body>
<%
Dim iMsg
Set iMsg = CreateObject("CDO.Message")
Dim iConf
Set iConf = CreateObject("CDO.Configuration")
Dim Flds
Set Flds = iConf.Fields
Flds( "http://schemas.microsoft.com/cdo/configuration/sendusing") = 1
Flds("http://schemas.microsoft.com/cdo/configuration/smtpserverpickupdirectory") = "c:\inetpub\mailroot\pickup" '<-----xxx this path needs to point to the right place on the server. The hosts will know what it should say. Most probably, it will stay the same.
Flds.Update
Set iMsg.Configuration = iConf
iMsg.To = "email address" ' <---a real email address is in the actual script--->
iMsg.From = Request.Form.Item("email")
iMsg.Subject = "form submission"
iMsg.TextBody = "TradeName: " & Request.Form.Item("TradeName") & vbCrLf & "Address: " & Request.Form.Item("Address") & vbCrLf & "Post Code: " & Request.Form.Item("PostCode") & vbCrLf & "Contact Name: " & Request.Form.Item("ContactName") & vbCrLf & "Email: " & Request.Form.Item("Email") & vbCrLf & "Web Address: " & Request.Form.Item("WebAddress") & vbCrLf & "Holidays: " & Request.Form.Item("Holidays") & vbCrLf & "InnsPubs: " & Request.Form.Item("InnsPubs") & vbCrLf & "Leisure: " & Request.Form.Item("Leisure") & vbCrLf & "Hobbies: " & Request.Form.Item("Hobbies") & vbCrLf & "ComputersICT: " & Request.Form.Item("ComputersICT") & vbCrLf & "ConsumerElec: " & Request.Form.Item("ConsumerElec") & vbCrLf & "BankingFinance: " & Request.Form.Item("BankingFinance") & vbCrLf & "LandEstate: " & Request.Form.Item("LandEstate") & vbCrLf & "HomeHousehold: " & Request.Form.Item("HomeHousehold") & vbCrLf & "ShopsStores: " & Request.Form.Item("ShopsStores")
iMsg.AddAttachment Request.Form.Item("file"), Request.Form.Item("file")
iMsg.Send
%>
<a href="http://www.....">Back to home page</a>
</body>
</html>
Submitted form-field values are sent to the target email address OK, except the most important one of all, a file field, which is the main point of the script - hence:
iMsg.AddAttachment Request.Form.Item("file"), Request.Form.Item("file").
The error messsage I get is:
Error Type:
CDO.Message.1 (0x800C000D)
The specified protocol is unknown.
/MyWeb/SscapeForm2email.asp, line 22
Why is this? This is a total mystery to me, especially as the person who did the script for me did send me the results of an initial testing of the script which worked OK; that is, submitted form field values, including an attchment via the file-field, was sent to my email address.
But when I attempt to run it, I get this error message...
The only thing that I changed in the ASP script, was the target email address (for obvious reasons), but everything else is exactly the same. So I'm totally confused here.
I could of course 'simply' get in touch with the person who did the script, but he's difficult to get hold of, and tends to want to charge (given half a chance) for even a few minutes of his time.
Anyway, can anyone tell me why this script isn't working for me the way it was for him, and what, if anything, I need to change in it?
Is there perhaps, a componant missing in my IIS instalation, however unlikely? Or is it something that I'm not specifying in the 'form-action' of the htm page? I don't know...
But, if it's of any help/consequence, the form-action is:
<form action="scriptname.asp" method="post" name="DummyName">
Appologies for long message..