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
Solved

Formail.asp in Apache not working

Posted on 2009-07-14
2
489 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
  • 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

Connect further...control easier

With the ATEN CE624, you can now enjoy a high-quality visual experience powered by HDBaseT technology and the convenience of a single Cat6 cable to transmit uncompressed video with zero latency and multi-streaming for dual-view applications where remote access is required.

Question has a verified solution.

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

Introduction Knockoutjs (Knockout) is a JavaScript framework (Model View ViewModel or MVVM framework).   The main ideology behind Knockout is to control from JavaScript how a page looks whilst creating an engaging user experience in the least …
SASS allows you to treat your CSS code in a more OOP way. Let's have a look on how you can structure your code in order for it to be easily maintained and reused.
Viewers will learn about the regular for loop in Java and how to use it. Definition: Break the for loop down into 3 parts: Syntax when using for loops: Example using a for loop:
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…

790 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