Solved

formmail error 405

Posted on 2006-06-25
8
879 Views
Last Modified: 2008-01-09
a formmail I'm trying to implement is returning the following error

error 405

The page you are looking for cannot be displayed because an invalid method (HTTP verb) was used to attempt access.

I have included my front end code below, is this a permissions problem?


 <form id="enquiry" method="post" action="sendmail.asp">
    <p><INPUT TYPE="hidden" NAME="recipient" VALUE="steve@stevenkennell.com">
<input type="hidden" NAME="subject" value="photography enquiry">
    <p class="style1"><span class="style26">Name:</span>  
      <INPUT TYPE="text" id="name" NAME="realname" SIZE="76">
    <p class="style1"><span class="style26">Email Address:</span>
      <INPUT TYPE="text" NAME="email" SIZE="66">
    <p class="style7"><span class="style8">
    <TEXTAREA NAME="comments" ROWS="3" COLS="80">Message:</TEXTAREA>
    </span>
      <input type="hidden" name="required" value="realname, email, comments">
      <p>
      <input type="hidden" name="redirect" value="http://www.stevenkennell.com/contact/done.htm">
  <input name="submit" type="submit" id="submit" value="Submit">
  <input name="reset" type="reset" id="reset" value="Reset">
0
Comment
Question by:sousflai
  • 4
  • 3
8 Comments
 
LVL 21

Expert Comment

by:ap_sajith
ID: 16978491
Can you post the code used in sendmail.asp?.. I assume you are getting an error in senmail.asp?

Cheers!
0
 

Author Comment

by:sousflai
ID: 16978516
The .net framework wasn't enabled, though now it's giving a 500 error maessage, hmmmmmmm
<%@ LANGUAGE="VBScript" %>
<% '***************************************************************************
   '* ASP FormMail                                                            *
   '*                                                                         *
   '* Do not remove this notice.                                              *
   '*                                                                         *
   '* Copyright 1999-2002 by Mike Hall.                                       *
   '* Please see http://www.brainjar.com for documentation and terms of use.  *
   '***************************************************************************

   '- Customization of these values is required, see documentation. -----------

   referers   = Array(www.stevenkennell.com)
   mailComp   = "ASPMail"
   smtpServer = "mail.stevenkennell.com"
   fromAddr   = "steve@stevenkennell.com"

   '- End required customization section. -------------------------------------

   Response.Buffer = true
   errorMsgs = Array()

   'Check for form data.

   if Request.ServerVariables("Content_Length") = 0 then
     call AddErrorMsg("No form data submitted.")
   end if

   'Check if referer is allowed.

   if UBound(referers) >= 0 then
     validReferer = false
     referer = GetHost(Request.ServerVariables("HTTP_REFERER"))
     for each host in referers
       if host = referer then
         validReferer = true
       end if
     next
     if not validReferer then
       if referer = "" then
         call AddErrorMsg("No referer.")
       else
         call AddErrorMsg("Invalid referer: '" & referer & "'.")
       end if
     end if
   end if

   'Check for the recipients field.

   if Request.Form("_recipients") = "" then
     call AddErrorMsg("Missing email recipient.")
   end if

   'Check all recipient email addresses.

   recipients = Split(Request.Form("_recipients"), ",")
   for each name in recipients
     name = Trim(name)
     if not IsValidEmailAddress(name) then
       call AddErrorMsg("Invalid email address in recipient list: " & name & ".")
     end if
   next
   recipients = Join(recipients, ",")

   'Get replyTo email address from specified field, if given, and check it.

   name = Trim(Request.Form("_replyToField"))
   if name <> "" then
     replyTo = Request.Form(name)
   else
     replyTo = Request.Form("_replyTo")
   end if
   if replyTo <> "" then
     if not IsValidEmailAddress(replyTo) then
       call AddErrorMsg("Invalid email address in reply-to field: " & replyTo & ".")
     end if
   end if

   'Get subject text.

   subject = Request.Form("_subject")

   'If required fields are specified, check for them.

   if Request.Form("_requiredFields") <> "" then
     required = Split(Request.Form("_requiredFields"), ",")
     for each name in required
       name = Trim(name)
       if Left(name, 1) <> "_" and Request.Form(name) = "" then
         call AddErrorMsg("Missing value for " & name)
       end if
     next
   end if
0
 
LVL 21

Expert Comment

by:ap_sajith
ID: 16978532
Can you please post the complete error message here... Including the line number and the descreption. If you are just getting a generic 500 error message, then you need to reset you browser preferences.
In IE, Click on Tools > Internet Oprions > Advanced  and uncheck the 'Show friendly HTTP error messages'. Save your options and refresh the page again.

Cheers!
0
Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

 

Author Comment

by:sousflai
ID: 16978623
thanks for the advice, unfortunately the same error message still occurs, I have included the body script and a link to the asp file, I hope this helps,

thanx steve

www.stevenkennell.com/scripts/formmail.asp



<form action="../scripts/formmail.asp" method="post" name="form1" id="form1">>
<p>
<input name="_recipients" type="hidden" value="steve@stevenkennell.com" />
<input name="_requiredFields" type="hidden"
  value="realname, email, comments" />
    <p class="style1"><span class="style26">Name:</span>  
      <INPUT TYPE="text" id="name" NAME="realname" SIZE="76">
    <p class="style1"><span class="style26">Email Address:</span>
      <INPUT TYPE="text" NAME="email" SIZE="66">
    <p class="style7"><span class="style8">
    <TEXTAREA NAME="comments" ROWS="3" COLS="80">Message:</TEXTAREA>
    </span>
<input type="submit" value="Submit" />
<input type="reset" value="Clear" />
</p>
</form>
0
 
LVL 21

Accepted Solution

by:
ap_sajith earned 500 total points
ID: 16981245
I tried creating a page with the above form and tried to submit it to "www.stevenkennell.com/scripts/formmail.asp". I didnt get any error messages. I got a message -"Thank you, the following information has been sent:".

Can you paste the complete error message that your are getting?

Cheers!
0
 
LVL 26

Expert Comment

by:DireOrbAnt
ID: 16981374
HTTP Error 405 means that you can't use POST for this file type (ASP).

You can check IIS Config to see what verbs you allow for .ASP and add POST to the list.

If you don't know how to do that, please post what version of IIS you are using.

This might help you find out:
http://www.somacon.com/p126.php
0
 
LVL 21

Expert Comment

by:ap_sajith
ID: 17022278
@ sousflai, did you manage to solve this issue?. Do you need further assistance with this?

Cheers!
0
 

Author Comment

by:sousflai
ID: 17026884
I used a differnt formail script in the end which did work, thanks for the help
0

Featured Post

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Questions about INCLUDE FILES 2 37
jquery to restrict certain words from input in form 11 39
Html Table looping 4 25
Asp in server side with Mssql Server 7 4 27
Have you ever needed to get an ASP script to wait for a while? I have, just to let something else happen. Or in my case, to allow other stuff to happen while I was murdering my MySQL database with an update. The Original Issue This was written…
This demonstration started out as a follow up to some recently posted questions on the subject of logging in: http://www.experts-exchange.com/Programming/Languages/Scripting/JavaScript/Q_28634665.html and http://www.experts-exchange.com/Programming/…
Two types of users will appreciate AOMEI Backupper Pro: 1 - Those with PCIe drives (and haven't found cloning software that works on them). 2 - Those who want a fast clone of their boot drive (no re-boots needed) and it can clone your drive wh…
Established in 1997, Technology Architects has become one of the most reputable technology solutions companies in the country. TA have been providing businesses with cost effective state-of-the-art solutions and unparalleled service that is designed…

856 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