Solved

formmail error 405

Posted on 2006-06-25
8
882 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
[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
  • 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
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 

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

Instantly Create Instructional Tutorials

Contextual Guidance at the moment of need helps your employees adopt to new software or processes instantly. Boost knowledge retention and employee engagement step-by-step with one easy solution.

Question has a verified solution.

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

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…
I was asked about the differences between classic ASP and ASP.NET, so let me put them down here, for reference: Let's make the introductions... Classic ASP was launched by Microsoft in 1998 and dynamically generate web pages upon user interact…
In this video, viewers will be given step by step instructions on adjusting mouse, pointer and cursor visibility in Microsoft Windows 10. The video seeks to educate those who are struggling with the new Windows 10 Graphical User Interface. Change Cu…
If you’ve ever visited a web page and noticed a cool font that you really liked the look of, but couldn’t figure out which font it was so that you could use it for your own work, then this video is for you! In this Micro Tutorial, you'll learn yo…

705 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