• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 896
  • Last Modified:

formmail error 405

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
sousflai
Asked:
sousflai
  • 4
  • 3
1 Solution
 
ap_sajithCommented:
Can you post the code used in sendmail.asp?.. I assume you are getting an error in senmail.asp?

Cheers!
0
 
sousflaiAuthor Commented:
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
 
ap_sajithCommented:
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
Cloud Class® Course: CompTIA Cloud+

The CompTIA Cloud+ Basic training course will teach you about cloud concepts and models, data storage, networking, and network infrastructure.

 
sousflaiAuthor Commented:
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
 
ap_sajithCommented:
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
 
DireOrbAntCommented:
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
 
ap_sajithCommented:
@ sousflai, did you manage to solve this issue?. Do you need further assistance with this?

Cheers!
0
 
sousflaiAuthor Commented:
I used a differnt formail script in the end which did work, thanks for the help
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

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.

  • 4
  • 3
Tackle projects and never again get stuck behind a technical roadblock.
Join Now