After hours of looking on the internet and posting in forums and trying 10 different codes for php script, i start looking in my website providers' help database, and in there (and only in there) do they say that they do not support php form action scripts!?!?! Grr!

Can sombody help me get an easy asp form script? Below is the form and the fields:

<input name="name" type="text" id="name" value="name..">
          </p>
          <p> 
            <input name="email" type="text" id="email" value="email address..">
          </p>
          <p> 
            <textarea name="question" cols="50" rows="4">question..</textarea>
          </p>
          <p align="center">
            <input type="submit" name="Submit" value="Submit">

Thanks guys!!

Max

Member Avatar for GreenDay2001

what do you want to do with this with this form, first clarify that. u want a faq or work with database or whatever. . .

what do you want to do with this with this form, first clarify that. u want a faq or work with database or whatever. . .

just somthing which emails the results to me. Its basically for common questions and if sombody needs any information then they can just put their question into the question section and the form will email me the results to all the form (hopfully :P)

Thanks,
Max Mumford.

Member Avatar for GreenDay2001

well what you have to do is to create a CDO object. i havn'r checked this code since right now i am not posting this script from my computer so it doesn't have IIS installed if you have any problems reply.

<%
Set myMail=CreateObject("CDO.Message")
myMail.Subject="Question"
myMail.From=Request.QueryString("email")
myMail.To="you@yourdomain.com"
myMail.TextBody=Request.QueryString("question")
myMail.Send
%>
Member Avatar for GreenDay2001

if u want to what the above code mean reply . . .

Thanks for the code but its not working on my site :( i know asp works because i have some code which replies on the next page with what the user put in (here: [URL]http://www.themepics.co.uk/convoform1.asp[/URL]) which is all working ok but the form script isnt working for my feedback form :/ what information do you need to determine why it isnt working? this is the code im using at the moment:

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>form test</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>
<body>
<form name="form1" method="post" action="formtest.asp">
  <input name="name" type="text" id="name" value="name..">
  <p> 
    <input name="email" type="text" id="email" value="email address..">
  </p>
  <p> 
    <textarea name="question" cols="50" rows="4">question..</textarea>
  </p>
  <p align="center"> 
    <input type="submit" name="Submit" value="Submit">
</form>
<%
Set myMail=CreateObject("CDO.Message")
myMail.Subject="Question"
myMail.From=Request.QueryString("email")
myMail.To="example@example.com"
myMail.TextBody=Request.QueryString("question")
myMail.Send
%>
</body>
</html>

Thanks,
Max

ps also another wierd thing, when i go on my formtest.asp page with the feedback code in it, it displays the form and the asp code above my error page ([URL]http://www.themepics.co.uk/error.htm[/URL] and [URL]http://www.themepics.co.uk/formtest.asp[/URL])

Member Avatar for GreenDay2001

try the following steps, since i dont know which files have you made for this forms..
1. make a html page which contains only HTML code, i mean only form, no asp. Set action to formaction.asp or formtest whatever
2. In the action page i.e. ASP write the code I had given to you. See if it works.

if still doesn't works i would try myself on the web.

try the following steps, since i dont know which files have you made for this forms..
1. make a html page which contains only HTML code, i mean only form, no asp. Set action to formaction.asp or formtest whatever
2. In the action page i.e. ASP write the code I had given to you. See if it works.

if still doesn't works i would try myself on the web.

I have done all that and saved it as a file called form.htm with the code in formcode.asp

(http://www.themepics.co.uk/formcode.asp)
(http://www.themepics.co.uk/form.htm)

But when i click submit for the form it shows my error page. Is this becaquse dreamweaver has not uploaded it correctly or there is an error with my host fasthosts? (http://www.fasthosts.com)

ps THANKS so much for all the help!!

Max

pps: This might help:


Knowledge Base[IMG]http://xtreme.fasthosts.co.uk/images/corner2.gif[/IMG] PROBLEM: My sendmail script doesn't work under Windows

This article applies to:

  • All Accounts

Summary
The sendmail script can only be used on Linux servers. It does not work on Windows servers. For Windows servers you should use Jmail or CDONTS.
© 2006 All images and content are the property of Fasthosts Internet Limited
.... stupid fasthosts :( iv had no trouble until this lol)

Member Avatar for GreenDay2001

are you talking about ASP. I didn't understand what your last post was about....or what does it mean.

are you talking about ASP. I didn't understand what your last post was about....or what does it mean.

its a question and answer from my website host's knoledge or FAQ base. It basically says (i think) that CDONTS and JMAIL are the only type of sendmail script that works. Do you know these scripts? i have had no experience with them.

Max

Member Avatar for GreenDay2001

It basically says (i think) that CDONTS and JMAIL are the only type of sendmail script that works.

I think they are saying that CDONTS and JMAIL are the sendmail scripts that work in their server.

You can find more information about CDONTS here:
http://support.microsoft.com/kb/186204

vishesh

thanks! ill take a look at them now.

Max

I LOVE YOU!!!!!!!!!! lol THANKS SOSOSOSO much for all your help, the JMAIL one worked!! THANKS!! OH MY GOODNESS thats such a releif lol i have several forms on my website which are not working because i cannot get the forms right but now thay can!! THANK YOU!!!!!!!!

FINALLY!! a code which works!! below is a copy of some code which i got from that jmail website you gave me the link to which i edited a bit to work on one of my forms. How would i make a form like this one but with only name and 5 radio button options send with the same options?

<%
Response.Buffer = True
'Dimension variables
Dim strBody 'Holds the body of the e-mail
Dim objJMail 'Holds the mail server object
Dim strMyEmailAddress 'Holds your e-mail address
Dim strSMTPServerAddress 'Holds the SMTP Server address
Dim strCCEmailAddress 'Holds any carbon copy e-mail addresses if you want to send carbon copies of the e-mail
Dim strBCCEmailAddress 'Holds any blind copy e-mail addresses if you wish to send blind copies of the e-mail
Dim strReturnEmailAddress 'Holds the return e-mail address of the user



strMyEmailAddress = "example@example.co.uk"
strSMTPServerAddress = "smtp.example.com"
strCCEmailAddress = "example@example.com"
strBCCEmailAddress = ""


strReturnEmailAddress = Request.Form("email")



strBody = "<h2>E-mail sent from form on Web Site</h2>"
strBody = strBody & "<br><b>Name: </b>" & Request.Form("Name")
strBody = strBody & "<br><b>E-mail: </b>" & strReturnEmailAddress
strBody = strBody & "<br><b>Question: </b>" & request.form("question")
If Len(strReturnEmailAddress) < 5 OR NOT Instr(1, strReturnEmailAddress, " ") = 0 OR InStr(1, strReturnEmailAddress, "@", 1) < 2 OR InStrRev(strReturnEmailAddress, ".") < InStr(1, strReturnEmailAddress, "@", 1) Then
strReturnEmailAddress = strMyEmailAddress
End If
Set objJMail = Server.CreateObject("JMail.SMTPMail")
objJMail.ServerAddress = strSMTPServerAddress
objJMail.Sender = strReturnEmailAddress
objJMail.SenderName = Request.Form("Name")
objJMail.AddRecipient strMyEmailAddress
objJMail.AddRecipientCC strCCEmailAddress
objJMail.AddRecipientBCC strBCCEmailAddress
objJMail.Subject = "Enquiry sent from enquiry form on website"



objJMail.HTMLBody = strBody


objJMail.Body = strBody
objJMail.Priority = 3
objJMail.Execute


Set objJMail = Nothing
%>
<html>
<head>

Thanks again!! Your my new website guru :mrgreen:
Max:cheesy:

(note: i took out the info which is not read by the server which tells me what each section does so i might have clipped a bit of code out by accident but it works with the actual version anyway

FINALLY!! a code which works!! below is a copy of some code which i got from that jmail website you gave me the link to which i edited a bit to work on one of my forms. How would i make a form like this one but with only name and 5 radio button options send with the same options?

<%
Response.Buffer = True
'Dimension variables
Dim strBody 'Holds the body of the e-mail
Dim objJMail 'Holds the mail server object
Dim strMyEmailAddress 'Holds your e-mail address
Dim strSMTPServerAddress 'Holds the SMTP Server address
Dim strCCEmailAddress 'Holds any carbon copy e-mail addresses if you want to send carbon copies of the e-mail
Dim strBCCEmailAddress 'Holds any blind copy e-mail addresses if you wish to send blind copies of the e-mail
Dim strReturnEmailAddress 'Holds the return e-mail address of the user


strMyEmailAddress = "example@example.co.uk"
strSMTPServerAddress = "smtp.ntlworld.com"
strCCEmailAddress = "example@example.com" 
strBCCEmailAddress = "" 

strReturnEmailAddress = Request.Form("email")


strBody = "<h2>E-mail sent from form on Web Site</h2>"
strBody = strBody & "<br><b>Name: </b>" & Request.Form("Name")
strBody = strBody & "<br><b>E-mail: </b>" & strReturnEmailAddress
strBody = strBody & "<br><b>Question: </b>" & request.form("question")
If Len(strReturnEmailAddress) < 5 OR NOT Instr(1, strReturnEmailAddress, " ") = 0 OR InStr(1, strReturnEmailAddress, "@", 1) < 2 OR InStrRev(strReturnEmailAddress, ".") < InStr(1, strReturnEmailAddress, "@", 1) Then
strReturnEmailAddress = strMyEmailAddress
End If 
Set objJMail = Server.CreateObject("JMail.SMTPMail")
objJMail.ServerAddress = strSMTPServerAddress
objJMail.Sender = strReturnEmailAddress
objJMail.SenderName = Request.Form("Name")
objJMail.AddRecipient strMyEmailAddress
objJMail.AddRecipientCC strCCEmailAddress
objJMail.AddRecipientBCC strBCCEmailAddress
objJMail.Subject = "Enquiry sent from enquiry form on website"


objJMail.HTMLBody = strBody

objJMail.Body = strBody
objJMail.Priority = 3 
objJMail.Execute

Set objJMail = Nothing
%>
<html>
<head>

Thanks again!! Your my new website guru :mrgreen:
Max:cheesy:

(note: i took out the info which is not read by the server which tells me what each section does so i might have clipped a bit of code out by accident but it works with the actual version anyway

only thing is, how do i make the form get the results for radio buttons and list menu things? here is an example code which includes a list and radio buttons:

<form name="form1" method="post" action="">
  <p> 
    <label> 
    <input type="radio" name="RadioGroup1" value="radio">
    Radio1</label>
    <br>
    <label> 
    <input type="radio" name="RadioGroup1" value="radio">
    Radio2</label>
    <br>
    <select name="select">
      <option>a</option>
      <option>b</option>
      <option>c</option>
      <option>d</option>
      <option>e</option>
      <option>f</option>
    </select>
  </p>
  <p>
    <input type="submit" name="Submit" value="Submit">
  </p>
  </form>

here is some of the code i am using at the moment:

Response.Buffer = True
Dim strBody    'Holds the body of the e-mail
Dim objJMail    'Holds the mail server object
Dim strMyEmailAddress   'Holds your e-mail address
Dim strSMTPServerAddress 'Holds the SMTP Server address
Dim strCCEmailAddress  'Holds any carbon copy e-mail addresses if you want to send carbon copies of the e-mail
Dim strBCCEmailAddress  'Holds any blind copy e-mail addresses if you wish to send blind copies of the e-mail
Dim strReturnEmailAddress 'Holds the return e-mail address of the user
strMyEmailAddress = "example@example.com"
strSMTPServerAddress = "smtp.example.com"
strCCEmailAddress = "" 'Use this string only if you want to send the carbon copies of the e-mail
strBCCEmailAddress = ""
strReturnEmailAddress = Request.Form("email")
strBody = "<h2>E-mail sent from form on Web Site</h2>"
(Request.Form("list1")) > "a" Then
 strBody = strBody & "<br>  " & Request.Form("country")
If Len(strReturnEmailAddress) < 5 OR NOT Instr(1, strReturnEmailAddress, " ") = 0 OR InStr(1, strReturnEmailAddress, "@", 1) < 2 OR InStrRev(strReturnEmailAddress, ".") < InStr(1, strReturnEmailAddress, "@", 1) Then
 strReturnEmailAddress = strMyEmailAddress
End If 
 & "list2" & "list3"
Set objJMail = Server.CreateObject("JMail.SMTPMail")
objJMail.ServerAddress = strSMTPServerAddress
objJMail.Sender = strReturnEmailAddress
objJMail.SenderName = Request.Form("email")
objJMail.AddRecipient strMyEmailAddress
objJMail.AddRecipientCC strCCEmailAddress
objJMail.AddRecipientBCC strBCCEmailAddress
objJMail.Subject = "Enquiry sent from enquiry form on website"
objJMail.HTMLBody = strBody
'objJMail.Body = strBody
objJMail.Priority = 3 
objJMail.Execute

Set objJMail = Nothing
%>

thanks again again again again lol. Max

Can an admin take out all email addresses from this thread? They are getting picked up by crawlers and sold to spammers.

Either that or somebody tell me how I can do it; no edit button...

Thanks,
Max.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.