Sending a feedback form via email

Author Message
Mark of Gilliad

  • Total Posts : 1
  • Scores: 0
  • Reward points : 0
  • Joined: 6/22/2008
  • Status: offline
Sending a feedback form via email Sunday, June 22, 2008 9:10 PM (permalink)
0
Hi everyone, I haven't posted here before but I could use some help or a few tips.

I am currently producing a website for an individual and want to have a form on the site for the user to enter feedback.  When they click submit the form is to send their message to an email address.  I have some code for it but unfortunately I can't get it to work.

I was wondering if anyone could have a look over it and give me any advice?

The form http://squallmoogle.webng.com/contact.asp

  <%@LANGUAGE="VBSCRIPT"%>
  <html>
  <head>
  <title>Community Mentors- Contact us</title>
  
  <!--The below line links to the Stylesheet for the website-->
  <LINK href="styletest2.css" type=text/css rel=stylesheet>
  </head>
  
  <body>
  <!--Div tag for the header section, this contains the page banner-->
  <DIV id=header></DIV>
  
  <!--The Div section for the page as a whole-->
  <DIV class=clearfix id=wrapper></DIV>
  
  <!--A small div area to create a gap between the header and the rest of the page -->
  <div id=breathingspace1></div>
  
  <!--The div section for the left side of the page-->
  <DIV id=leftcol>
  <!--#include file="navigation.txt" -->
  </DIV>
  
  <!--A small div area to create a gap between the navigation menu and the main section -->
  <div id=breathingspace2></div>
  
  <!--The div section for the main section of the page-->
  <DIV id=maincol>
  
  <h1>Contact us</h1>
  
  <form method="POST" action="contacting.asp">
  <p>Fields marked (*) are required.</p>
  
  <p>Feel free to provide your phone number in the message if you would prefer to be contacted that way.<br>
  </p>
  
  <p>name:<br />
  <input type="text" name="name" id="message"></p>
  <p>Your email:<br />
  <input type="text" name="email" id="email"></p>
  <p>message:* <br />
  <textarea style="width: 350px; height: 150px" name="message" id="message"></textarea></p>
  <p><input type="submit" value="Send email"></p>
  </form>
  
  <h2>Alternative methods for contacting us</h2>
  
  <p><b>Tel:</b> 0117 955 3062</p>
  <p><b>Fax:</b> 0117 907 6709</p>
  <p><b>Email:</b> JT@comminitymentors.org.uk</p>
  <p><b>Postal Address:</b><br />
  Community Mentors LTD<br />
  28 Sandbed Road<br />
  Bristol<br />
  BS2 9TX</p>
  </div>
  
  
  </body>
  </html>
  


The page to send the form:

  <html>
  <head>
  
  <%@LANGUAGE="VBSCRIPT"%>
  
  <%option explicit%>
  
  <%
  
  ' declare variables
  Dim EmailFrom
  Dim EmailTo
  Dim Subject
  Dim name
  Dim message
  
  ' get posted data into variables
  EmailFrom = Trim(Request.Form("email")) 
  EmailTo = "Sniper_Mark@hotmail.com"
  Subject = "Feedback recieved"
  name = Trim(Request.Form("name")) 
  message = Trim(Request.Form("message")) 
  
  ' validation
  Dim validationOK
  validationOK=true
  If (Trim(message)="") Then validationOK=false
  
  ' prepare email body text
  Dim Body
  Body = Body & "name: " & name & VbCrLf
  Body = Body & "message: " & message & VbCrLf
  
  ' send email 
  Dim mail
  Set mail = Server.CreateObject("CDONTS.NewMail") 
  mail.To = EmailTo
  mail.From = EmailFrom
  mail.Subject = Subject
  mail.Body = Body
  mail.Send 
  
  %>
  
  
  <title>Community Mentors Feedback</title>
  <!--The below line links to the Stylesheet for the website-->
  <LINK href="styletest2.css" type=text/css rel=stylesheet>
  </head>
  
  <body>
  
  <!--Div tag for the header section, this contains the page banner-->
  <DIV id=header></DIV>
  
  <!--The Div section for the page as a whole-->
  <DIV class=clearfix id=wrapper></DIV>
  
  <!--A small div area to create a gap between the header and the rest of the page -->
  <div id=breathingspace1></div>
  
  <!--The div section for the left side of the page-->
  <DIV id=leftcol>
  <!--#include file="navigation.txt" -->
  </DIV>
  
  <!--A small div area to create a gap between the navigation menu and the main section -->
  <div id=breathingspace2></div>
  
  <!--The div section for the main section of the page-->
  <DIV id=maincol>
  
  <% If validationOK = true Then %>
  
      <h1>Thanks For Your Feedback</h1>
  
  <p>We shall reply to you as quickly as humanly possible</p>
  
  <% else %>
  
  <h1>Error</h1>
  
  <p>You left the message field blank, please try again</p>
  
  <% end if %>
  
  </DIV>
  </body>
  </html>
  


Thanks.
 
#1
    dodad

    • Total Posts : 3
    • Scores: 0
    • Reward points : 0
    • Joined: 6/26/2008
    • Status: offline
    RE: Sending a feedback form via email Friday, June 27, 2008 7:11 AM (permalink)
    0
    What doesn't work?
     
    If the page doesn't error out then I'd make sure relaying is turned on on your SMTP server.
     
    #2

      Online Bookmarks Sharing: Share/Bookmark

      Jump to:

      Current active users

      There are 0 members and 1 guests.

      Icon Legend and Permission

      • New Messages
      • No New Messages
      • Hot Topic w/ New Messages
      • Hot Topic w/o New Messages
      • Locked w/ New Messages
      • Locked w/o New Messages
      • Read Message
      • Post New Thread
      • Reply to message
      • Post New Poll
      • Submit Vote
      • Post reward post
      • Delete my own posts
      • Delete my own threads
      • Rate post

      2000-2012 ASPPlayground.NET Forum Version 3.9