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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

creating a email web form

Status
Not open for further replies.

xstranded

Technical User
Oct 26, 2003
15
US
Hello All, for my website i've been trying to create a email web form... i can get the layout ok, but when it comes to the script thing i dont know what to do? or actually, i have NO idea what to do outside of the HTML part :D

i have my own server, so i have full access to everything.

are there any scripts i have to add?

thank you all very much for the help.

\\||// ::xstranded
==== its the bind between art and soul
//||\\ and the union of body and sound
<::>
 
there's also a great FAQ in the ASP forum

faq333-2962


--------------------------------------------------------------------------------
 
Your cheapest and easiest bet would be to configure CDONTS and use asp to send your mail.
<%
Dim objNewMail
Set objNewMail = Server.CreateObject(&quot;CDONTS.NewMail&quot;)
objNewMail.From = request.form(&quot;fromField&quot;)
objNewMail.To = request.form(&quot;toField&quot;)
objNewMail.Subject = request.form(&quot;subjectField&quot;)
objNewMail.Body = &quot;This is the body mail.&quot;
objNewMail.Send

Your body can be a variable too like above
objNewMail.Body = request.form(&quot;bodyField&quot;)

Hope it helps

thereptilian120x120.gif
 
hi thank you for the replies... the only thing i'm not to sure how to code it.

i totally understand HTML but not sure what to put into the fields

\\||// ::xstranded
==== its the bind between art and soul
//||\\ and the union of body and sound
<::>
 
if you know how to submit an HTML form you can use the samples we provided



Let's assume you have a page with a form, this page name is test.htm and it contains one text field and the submit button


The Form
<form name=&quot;MyForm&quot; action=&quot;action.asp&quot;
method=&quot;get&quot;>
Username:
<input type=&quot;text&quot; name=&quot;email&quot;>
<input type=&quot;submit&quot; value=&quot;Submit&quot;>
</form>





Action.asp Page (where the above page is sent to)
<%
set objMail = Server.CreateObject(&quot;CDONTS.Newmail&quot;)
objMail.From = request.form(&quot;email&quot;)' Specify sender's address (only one)
objMail.To = &quot;you@yourdomain.com&quot; 'Use ; to seperate items in a list of recipients
objMail.Cc = &quot;someoelse@yourdomain.com&quot;
objMail.Bcc = &quot;someoelseagain@yourdomain.com&quot;
objMail.AttachFile = &quot;c:\images\bgates.gif&quot; 'How to add an attachment
objMail.Subject = &quot;TESTING this Email with ASP using CDONTS&quot;
objMail.Body = &quot;Ignore this email. It is only a test.&quot;
'---or---
objMail.Body = &quot;<html><body><h1>TESING this email!</h1>It is only a test</body></html>&quot;
objMail.BodyFormat = 0
'--Finally, send it
objMail.Send
%>



Very simple to understand xstranded, give it a shot. One thing tho, run both pages in you server IIS

pinky1.jpg width='75' height='75'
[/tt]
056.jpg
 
lol...
my lunches are usually long :) haha, no thank you Alsoknown as... that was very helpful.. and i did get it. i just needed it broken down real quick... i do appreciate the help. and of course you get a star :)

hehehe...

thanks again :) *thumbs up*

\\||// ::xstranded
==== its the bind between art and soul
//||\\ and the union of body and sound
<::>
 
** Anytime **

[sup]Glad to help. Simply returning the favor for the amount of times I've been and will be helped...[/sup]

pinky1.jpg width='75' height='75'
[/tt]
056.jpg
 
Well, I won't be showing up at the victory dinner because I still don't get it! Could one of you folks please take a look at these pages and (view source) and tell me what I might be missing? This form stuff has been very frustrating for me. The &quot;test&quot; page is sending the form somewhere, so that's progress, but I don't know where it's going.

Both pages are residing up in the web server that hosts my site in the same place (main file). I'm afraid I don't know exactly what the &quot;server ISS&quot; is.

Perhaps my host doesn't support CDONTS? I know if I ask, they'll simply fire back links to BigNoseBird.com

I'm a graphic artist, not good with coding and I'd be very grateful for any additional help.
Thanks!
Zavsays zavsays@comcast.net
 
change your code from:

<html>
<head>
<title>test</title><br>
<form name=&quot;MyForm&quot; action=&quot;action.asp&quot;
method=&quot;get&quot;>
Username:
<input type=&quot;text&quot; name=&quot;email&quot;>
<input type=&quot;submit&quot; value=&quot;Submit&quot;>
</form>
</body>
</html>

TO

<html>
<head>
<title>test</title><br>
<form name=&quot;MyForm&quot; action=&quot;action.asp&quot;
method=&quot;post&quot;>
Username:
<input type=&quot;text&quot; name=&quot;email&quot;>
<input type=&quot;submit&quot; value=&quot;Submit&quot;>
</form>
</body>
</html>


other wise if you have method=&quot;get&quot;


your email page should not be requesting whatever is sent to it from the form field but the url

objMail.From = request.querystring(&quot;email&quot;)'


pinky1.jpg width='75' height='75'
[/tt]
056.jpg
 
Thanks for writing back AlsoKnownAs. I appreciate your taking the time! I did make those changes and I'm now getting a &quot;Method Not Allowed - The requested method POST is not allowed for the URL /action.asp.&quot; message. I'll keep plugging away.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top