Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

ASP.NET Forum


You are currently viewing our ASP.NET Forum as a guest. Please register to participate.
Login



Reply
ASP script mysatery that's driving me mad
Old 04-26-2006, 07:47 AM ASP script mystery that's driving me mad
Novice Talker

Posts: 7
Trades: 0
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..

Last edited by andrew jenery; 04-26-2006 at 07:54 AM.. Reason: mispelled word in title
andrew jenery is offline
Reply With Quote
View Public Profile
 
 
Register now for full access!
Old 04-26-2006, 08:49 AM Re: ASP script mysatery that's driving me mad
chrishirst's Avatar
Missing! presumed drunk.

Posts: 41,519
Name: Chris Hirst
Location: Blackpool. UK
Trades: 0
Your host probably has the IIS SMTP server disabled.

specify the server address along with a username and password in the fields configuration, delete the pickupdirectory line


<added; Typical of us programmers wanting to get paid when a client takes up some time >
__________________
Chris. ->> Links are advertising NOT optimising!! <<-
A foolish consistency is the hobgoblin of little minds
Thought for today:- I SEO the only industry where all the cowboys are Indians?

Last edited by chrishirst; 04-26-2006 at 08:50 AM..
chrishirst is online now
Reply With Quote
View Public Profile Visit chrishirst's homepage!
 
Old 04-26-2006, 12:48 PM Re: ASP script mysatery that's driving me mad
ADAM Web Design's Avatar
Canadastaninianite

Posts: 5,938
Name: Adam for web page design, not program
Location: Toronto, Ontario, Canada
Trades: 0
Change this:
Code:
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.
To this:
Code:
Flds("http://schemas.microsoft.com/cdo/configuration/smtp") = "mail.(your site name).com" or in some cases "(your site's IP address)"
Use the quotes and everything. Just change the parts in brackets.
__________________

Please login or register to view this content. Registration is FREE
|
Please login or register to view this content. Registration is FREE
(my blog)


Please login or register to view this content. Registration is FREE
(with proof)
ADAM Web Design is offline
Reply With Quote
View Public Profile Visit ADAM Web Design's homepage!
 
Old 04-27-2006, 11:46 PM Re: ASP script mysatery that's driving me mad
Novice Talker

Posts: 7
Trades: 0
Many thanks to all...

However, before I test the recommendations, maybe I should clarify my actual situation.

My host is on my local machine via IIS; that is, the site is still offline. Reason being, that I obviously need to be able to test this script for myself before I put the site online (upload it to a host's server).

So, in light of this, should I still check if my IIS SMTP server is disabled, and should I still change

Flds("http://schemas.microsoft.com/cdo/configuration/smtpserverpickupdirectory") = "c:\inetpub\mailroot\pickup"

to

Flds("http://schemas.microsoft.com/cdo/configuration/smtp") = "mail.(your site name).com" or in some cases "(your site's IP address)"
andrew jenery is offline
Reply With Quote
View Public Profile
 
Old 04-28-2006, 03:46 AM Re: ASP script mysatery that's driving me mad
chrishirst's Avatar
Missing! presumed drunk.

Posts: 41,519
Name: Chris Hirst
Location: Blackpool. UK
Trades: 0
is your IIS SMTP server configured to send out mail

have you checked the pickup and badmail folders?

you are better of testing with the mail server that the message will be sent through when live, otherwise you will probably have to change it anyway.

On my testing server I have a mail server and the IIS SMTP fully configured (on a different port ) but I always test mailing scripts with the mail server of the target hostname with a valid username and password.
__________________
Chris. ->> Links are advertising NOT optimising!! <<-
A foolish consistency is the hobgoblin of little minds
Thought for today:- I SEO the only industry where all the cowboys are Indians?
chrishirst is online now
Reply With Quote
View Public Profile Visit chrishirst's homepage!
 
Old 04-28-2006, 06:50 AM Re: ASP script mysatery that's driving me mad
Novice Talker

Posts: 7
Trades: 0
Many thanks...

If I click on IIS within Administrative Tools, I am presented with my 'local computer' icon.
If I click on the '+' symbol I get the folder 'Default SMTP Virtual Server.'
If I click on Properties I have the following options under 'General.'
Either '(All Unassigned)' or 'IP Address:'.
IP Address is selected (my IP address is showing).

I have nothing else with SMTP in it. However, if I expand this folder, I get 'Domains' and 'Current Sessions.'
If I click on Domains, I am presented with the name of my local machine in the right-hand pannel.
If I click on Properties, I get 'C:\Inetpub\mailroot\Drop'. A check-box with 'Enable drop directory quota' next to it is checked.

Anyway, does all this mean that my SMTP server is running?

I checked the pickup and badmail folders which are empty.
andrew jenery is offline
Reply With Quote
View Public Profile
 
Old 04-28-2006, 06:51 AM Re: ASP script mysatery that's driving me mad
Novice Talker

Posts: 7
Trades: 0
.....

Last edited by andrew jenery; 04-28-2006 at 06:53 AM..
andrew jenery is offline
Reply With Quote
View Public Profile
 
Old 04-28-2006, 01:47 PM Re: ASP script mysatery that's driving me mad
ADAM Web Design's Avatar
Canadastaninianite

Posts: 5,938
Name: Adam for web page design, not program
Location: Toronto, Ontario, Canada
Trades: 0
Isn't SMTP listed as a Service under the Services from Administrative Tools?
__________________

Please login or register to view this content. Registration is FREE
|
Please login or register to view this content. Registration is FREE
(my blog)


Please login or register to view this content. Registration is FREE
(with proof)
ADAM Web Design is offline
Reply With Quote
View Public Profile Visit ADAM Web Design's homepage!
 
Old 05-01-2006, 09:26 PM Re: ASP script mysatery that's driving me mad
Novice Talker

Posts: 7
Trades: 0
Many thanks - sorry for not replying before now...

Yes, I have Simple Mail Transport Protocol (I used to think that the 'S' stood for Standard...) under Services within Administrative Tools.
Had no idea it was listed there, and had'nt looked in Services before.
Anyway, the Status shows 'Started' and the 'Start-Up' type is set to Automatic.
I guess this means my SMTP is running...

Last edited by andrew jenery; 05-01-2006 at 09:27 PM..
andrew jenery is offline
Reply With Quote
View Public Profile
 
Old 05-07-2006, 08:21 AM Re: ASP script mysatery that's driving me mad
Novice Talker

Posts: 7
Trades: 0
So, now that my SMTP is running, should I now go ahead and change
'
Flds("http://schemas.microsoft.com/cdo/configuration/smtpserverpickupdirectory") = "c:\inetpub\mailroot\pickup" to
`
Flds("http://schemas.microsoft.com/cdo/configuration/smtp") = "mail.(your site name).com" or in some cases "(my site's IP address)"
andrew jenery is offline
Reply With Quote
View Public Profile
 
Old 05-08-2006, 01:30 AM Re: ASP script mysatery that's driving me mad
ADAM Web Design's Avatar
Canadastaninianite

Posts: 5,938
Name: Adam for web page design, not program
Location: Toronto, Ontario, Canada
Trades: 0
I would.
__________________

Please login or register to view this content. Registration is FREE
|
Please login or register to view this content. Registration is FREE
(my blog)


Please login or register to view this content. Registration is FREE
(with proof)
ADAM Web Design is offline
Reply With Quote
View Public Profile Visit ADAM Web Design's homepage!
 
Old 05-09-2006, 06:54 AM Re: ASP script mysatery that's driving me mad
Novice Talker

Posts: 7
Trades: 0
OK - will try this, but...
I have another question however - a fairly obvious one. Although my ASP knowledge is below 'limited', I'm wondering why the person who did the script for me used 'smtpserverpickupdirectory"' instead of 'smtp"?
Also, as I will once more be testing this script offline, why would "c:\inetpub\mailroot\pickup" be changed to "mail.(your site name).com"
or "(my site's IP address)"?
andrew jenery is offline
Reply With Quote
View Public Profile
 
Old 05-09-2006, 07:14 AM Re: ASP script mysatery that's driving me mad
chrishirst's Avatar
Missing! presumed drunk.

Posts: 41,519
Name: Chris Hirst
Location: Blackpool. UK
Trades: 0
probably the script developer had the IIS SMTP correctly and fully configured.

I have it properly setup on my dev server but I prefer to use the target host server for testing, it's one thing less to remember when transferring the code.

If you don't have everything set up on your IIS (DNS, Hostname, fixed IP or a Dynamic dns system, the ports opened plus other settings) SMTP won't work
__________________
Chris. ->> Links are advertising NOT optimising!! <<-
A foolish consistency is the hobgoblin of little minds
Thought for today:- I SEO the only industry where all the cowboys are Indians?
chrishirst is online now
Reply With Quote
View Public Profile Visit chrishirst's homepage!
 
Reply     « Reply to ASP script mysatery that's driving me mad
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 1.31172 seconds with 12 queries