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

forms

Status
Not open for further replies.

NSolano

IS-IT--Management
Feb 6, 2002
68
PE
I am new at web designing, I am praciticing by using MS frontpage 2000, and then fixing up the HTMl code and using some Java. I recently made a form so the results would be sent to my email, well it doesn't work the way i want it to. I click on the submit button and an email screen comes up, i thought it would automatically send it to my email with the form field names specified. I asked my web hosting provider and he said that i should use ASP, well I don;t know ASP. Anyone know another way i could do it, or a website that can help me learn some ASP to use in my form?? some code would be helpfull too
 
Find out if you have CDONTS or ASPmail Components.
then do a search online for
CDONTS example ASP
and or
ASPmail example ASP

this will give you plenty of very basic examples of using them and will get you going.
here's are two as simple as it will get also
save these seperatly and change the action attribute in the form tag to what you named the processing script
CDONTS (this example has no form fields added. use request to get the form fields posted and palce them in the Body field)
<%
Dim objMail
Set objMail = Server.CreateObject(&quot;CDONTS.NewMail&quot;)

objMail.From = &quot;rob@tconsult.com&quot;
objMail.Subject = &quot;How TO send email with CDONTS&quot;
objMail.To = &quot;someone@someplace.com&quot;
objMail.Body = &quot;This is an email message&quot; & vbcrlf&_
&quot;with CDONTS.&quot; & vbcrlf&_
&quot;It is really easy. &quot;
objMail.Send

Response.write(&quot;Mail was Sent&quot;)

'You must always do this with CDONTS.
set objMail = nothing
%>




ASPmail (this example loops thru all form fields)
<%
Set Mailer = Server.CreateObject(&quot;SMTPsvg.Mailer&quot;)
Mailer.FromName = &quot;Joes Widgets Corp.&quot;
Mailer.FromAddress = &quot;Joe@yourdomain.com&quot;
Mailer.RemoteHost = &quot;localhost&quot;
Mailer.AddRecipient &quot;John Smith&quot;, &quot;jsmith@anotherhostname.com&quot;
Mailer.Subject = &quot;Your Subject!&quot;

strMsgHeader = &quot;Form information follows&quot; & vbCrLf
for each qryItem in Request.QueryString
strMsgInfo = strMsgInfo & qryItem & &quot; - &quot; & request.querystring(qryItem) & vbCrLf
next
strMsgFooter = vbCrLf & &quot;End of form information&quot;
Mailer.BodyText = strMsgHeader & strMsgInfo & strMsgFooter

if Mailer.SendMail then
Response.Write &quot;Mail sent...&quot;
else
Response.Write &quot;Mail send failure. Error was &quot; & Mailer.Response
end if
%>


hope that kind of helps

A language that doesn't affect the way you think about programming is not worth knowing.
admin@onpntwebdesigns.com
 
w3schools has some excellent tutorials and references that I still refer back to on occasion. (Link to right under partners). You may also want to check out 4guysFromRolla.com and if you have problems with anything specific and can't find a good answer you could always ask at the ASP forum here at Tek-Tips.

-Tarwn --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- ---
For my next trick I will pull a hat out of a rabbit (if you think thats bad you should see how the pigeon feels...) :p
 
It would be helpful to see your form. Can you give us the full URL for your form.
If your web host has the FrontPage extensions installed on your site, you can build your form in FrontPage and it will submit to email if it is properly built. Hope I have been of some help,
Micheal

Please take a moment to stop by for Form Repair and Design or check out my FrontPage Form tutorials at
 
well i just delted my form. My website URL is newcleaners.com. Its just a normal form. ask for name, address, phone number, email address, comments, company name. Thasts about it. I just want it to send it to email without opening up the email page, I dont have the time to learn ASP because of all the AP classes I am tkaing and my job, plus i've looked at ASP and its not making much sense to me, thanks.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top