Solved

Formail.asp in Apache not working

Posted on 2009-07-14
2
495 Views
Last Modified: 2012-06-27
I am trying to move websites from a front page server to our new linux with open suse 11 and plesk 9.2.1.  I am aware that the plesk does not support front page extensions.  However when I move lets say a basic site that only true front page comes out is like contact us forms.  So I have deleted the front page code and made a simple formail.asp.  Our server has apache asp installed so I am not sure why this is not working but here is the code below and also the error messages with my form from the plesk server...

[Tue Jul 14 15:56:29 2009] [error] [asp] [11618] [debug] \t(Missing operator before Do?) <-->
[Tue Jul 14 15:56:29 2009] [error] [asp] [11618] [debug] String found where operator expected at /home/vhosts/xxxxxxxx.xxxx.com/httpdocs/formmail.asp line 21, at end of line <--> (Might be a runaway multi-line '' string starting on line 9) <-->
[Tue Jul 14 15:56:29 2009] [error] [asp] [11618] [debug] \t(Do you need to predeclare intact?) <-->
[Tue Jul 14 15:56:29 2009] [error] [asp] [11618] [debug] Bareword found where operator expected at /home/vhosts/xxxxxxxxx.xxxxxx.com/httpdocs/formmail.asp line 21, near "cdoSendUsingPort" <-->
[Tue Jul 14 15:56:29 2009] [error] [asp] [11618] [debug] \t(Missing operator before cdoSendUsingPort?) <-->
[Tue Jul 14 15:56:29 2009] [error] [asp] [11618] [debug] Bareword found where operator expected at /home/vhosts/xxxxxxxx.xxxxxxx.com/httpdocs/formmail.asp line 37, near ") <--> <--> <--> CB" <-->
[Tue Jul 14 15:56:29 2009] [error] [asp] [11618] [debug] \t(Missing operator before CB?) <-->
[Tue Jul 14 15:56:29 2009] [error] [asp] [11618] [debug] Bareword found where operator expected at /home/vhosts/xxxxxxxxxx.xxxxxx.com/httpdocs/formmail.asp line 43, near "0 then" <-->
[Tue Jul 14 15:56:29 2009] [error] [asp] [11618] [debug] \t(Missing operator before then?) <-->
[Tue Jul 14 15:56:29 2009] [error] [asp] [11618] [debug] String found where operator expected at /home/vhosts/xxxxxxx.xxxxxx.com/httpdocs/formmail.asp line 79, at end of line <-->
[Tue Jul 14 15:56:29 2009] [error] [asp] [11618] [debug] \t(Missing operator before ?) <-->
[Tue Jul 14 15:56:29 2009] [error] [asp] [11618] [error] error compiling formmail.asp: Can't find string terminator "'" anywhere before EOF at /home/vhosts/xxxxxxx.xxxxxxx.com/httpdocs/formmail.asp line 79. <--> , /usr/lib/perl5/vendor_perl/5.10.0/Apache/ASP.pm line 1468

<%@ LANGUAGE="VBSCRIPT" %>
 
<%
 
'Created by XXXXX
 
'Do Not Use this script without the comments intact
 
'There should be no reason to edit this script
 
 
 
sch = "http://schemas.microsoft.com/cdo/configuration/"
 
Set cdoConfig = CreateObject("CDO.Configuration")
 
 
 
With cdoConfig.Fields
 
    .Item(sch & "sendusing") = 2 ' cdoSendUsingPort 
 
    .Item(sch & "smtpserver") = "XXX.XXX.XXX.XXX"
 
    .update
 
End With
 
 
 
Set cdoMessage = CreateObject("CDO.Message")
 
 
 
 
 
CB = ""
 
 
 
for each whatever in request.form
 
    if instr(lcase(whatever), "x_") = 0 then
 
        CB = CB & whatever & ":" & vbcrlf
 
        CB = CB & request.form(whatever) & vbcrlf & vbcrlf
 
    end if
 
next
 
 
 
With cdoMessage
 
    Set .Configuration = cdoConfig
 
    .From = request.form("Email")
 
    .To = "XXX@XXXX.com"
 
    .Subject = "Contact from "
 
    .TextBody = CB
 
    .Send
 
End With
 
 
 
Set cdoMessage = Nothing
 
Set cdoConfig = Nothing
 
 
 
'redirect to specified URL
 
response.redirect "default.htm"
 
%>

Open in new window

0
Comment
Question by:cstallings
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
2 Comments
 
LVL 5

Accepted Solution

by:
Koma666 earned 500 total points
ID: 24877667
Try to change from
With cdoConfig.Fields
 
    .Item(sch & "sendusing") = 2 ' cdoSendUsingPort
 
    .Item(sch & "smtpserver") = "XXX.XXX.XXX.XXX"
 
    .update
 
End With

to

cdoConfig.Fields.Item(sch & "sendusing") = 2 ' cdoSendUsingPort
cdoConfig.Fields..Item(sch & "smtpserver") = "XXX.XXX.XXX.XXX"
cdoConfig.Fields..update

If the Error messages for line 21 are gone after that I would say that your Apache ASP does not know how to handle the with block. Then you need to change the with blocks to direct definitions.

Another suggestion is that there is something wrong with your tabs or blank spaces, try to delete the blank lines and the tabs and reformat your code.

0
 
LVL 5

Expert Comment

by:Koma666
ID: 24877684
Oh, and it looks like the Apache ASP can not handle your comments, try to remove all comments would also be a good test.
0

Featured Post

Save the day with this special offer from ATEN!

Save 30% on the CV211 using promo code EXPERTS30 now through April 30th. The ATEN CV211 connects a laptop directly to any server allowing you instant access to perform data maintenance and local operations, for quick troubleshooting, updating, service and repair.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

What is Node.js? Node.js is a server side scripting language much like PHP or ASP but is used to implement the complete package of HTTP webserver and application framework. The difference is that Node.js’s execution engine is asynchronous and event…
JavaScript has plenty of pieces of code people often just copy/paste from somewhere but never quite fully understand. Self-Executing functions are just one good example that I'll try to demystify here.
The viewer will learn how to create and use a small PHP class to apply a watermark to an image. This video shows the viewer the setup for the PHP watermark as well as important coding language. Continue to Part 2 to learn the core code used in creat…
The viewer will learn the benefit of using external CSS files and the relationship between class and ID selectors. Create your external css file by saving it as style.css then set up your style tags: (CODE) Reference the nav tag and set your prop…

726 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question