Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Rhinorhino on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

let user submit form anonymously? 1

Status
Not open for further replies.

OnAFan

Technical User
Joined
Mar 13, 2002
Messages
120
Location
US
Hello All, I have a question, I need help creating a form that lets the user submit a form anonymously...If I do the standard mailto: I get a warning that tells the user their email address will be given. I think I need to set the action to an .asp file, but I am not sure what to put in the .asp file. Any help would be greatly appriciated. Thank you in advance:)
(here's what i got so far)

<form method=&quot;post&quot; ENCTYPE = &quot;text/plain&quot; action=&quot;????????&quot; name=&quot; &quot;>
<textarea name=&quot;Embody&quot; rows=&quot;5&quot; cols=&quot;50&quot;></textarea>
<input name=&quot;recipient&quot; type=&quot;hidden&quot; value=&quot;mymail@domain.com&quot;>
<input type=&quot;submit&quot; name=&quot;Submit&quot; value=&quot;Submit&quot;>
<input type=&quot;reset&quot; name=&quot;Submit2&quot; value=&quot;Reset&quot;> </form>
 
Aha ... the answer to this lies with which operating system your web server is running on, and whether they can enable ASP and CDONTS.

If they can then this is an absolute breeze - more details later Derren
[Mediocre talent - spread really thin]
 
Hi Derren,
Windows...I am working off of PWS right now. All of this will eventually go onto IIS. Thanks,
-Terry
 
I am not entirely sure what you are after here, especially regarding the submitting a form anonymously and email, but here is an outline to get the ball rolling:

The action of the form needs to point to your asp page that you will create, so action=&quot;mailem.asp&quot;. We will keep the method to &quot;post&quot; as this does not result in ungainly querystrings. When the form is submitted a variable is sent to the server (or PWS) for each form field that you have. These can then be referenced in your asp page by using

Code:
<% request.form(&quot;embody&quot;) %>

So we can now write the asp code. This should go at the very top of your page:

Code:
<% option explicit
Dim mymail

Set myMail     = CreateObject(&quot;CDONTS.NewMail&quot;)
myMail.From    = &quot;contacts@domain.co.uk&quot;
myMail.To      = &quot;mymail@domain.com&quot;
myMail.Subject = &quot;Test email&quot;
myMail.Body    = request.form(&quot;embody&quot;)
myMail.Send
Set myMail = Nothing
%>

That's it, all you need to do to send an email (if CDONTS is enabled - and most IIS servers have this). Obviously you can change the values of some of the &quot;mymail.&quot; lines to match your requirements.

Make sure you save your file with an asp extension and that you view the file through the http protocol (&quot;//localhost&quot; on pws) to ensure that the asp is processed. Unfortunately, you will not have cdonts enabled on your pws machine, so you'll need to get it online.

Speak soon ...
Derren
[Mediocre talent - spread really thin]
 
Thank You so much Derren!!! Have a good one: )
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top