Solved

formmail error 405

Posted on 2006-06-25
8
877 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
 

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
How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

 
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

Find Ransomware Secrets With All-Source Analysis

Ransomware has become a major concern for organizations; its prevalence has grown due to past successes achieved by threat actors. While each ransomware variant is different, we’ve seen some common tactics and trends used among the authors of the malware.

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
IIS POST request being ignored 4 46
ASP Syntax for IF statement 21 51
SP to delete duplicates 15 55
ASP Focus problem 3 29
I recently decide that I needed a way to make my pages scream on the net.   While searching around how I can accomplish this I stumbled across a great article that stated "minimize the server requests." I got to thinking, hey, I use more than one…
Hello, all! I just recently started using Microsoft's IIS 7.5 within Windows 7, as I just downloaded and installed the 90 day trial of Windows 7. (Got to love Microsoft for allowing 90 days) The main reason for downloading and testing Windows 7 is t…
Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…
This video explains how to create simple products associated to Magento configurable product and offers fast way of their generation with Store Manager for Magento tool.

759 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

Need Help in Real-Time?

Connect with top rated Experts

26 Experts available now in Live!

Get 1:1 Help Now