Emailing Form Input Using ASP

Written by Amrit Hallan

Continued from page 1

. . .The form handling script. .


.<% Dim nName, eEmail, AllOk, bText, Mailer AllOk = True

' We use AllOk to see whether it is Ok to proceed further or not. If AllOk contains "False," we do not proceed. The use of AllOk here may seem needless here, but if there are many fields, it comes handy.

nName = Trim(Request.Form("name"))

eEmail = Trim(Request.Form("email))

If Len(eEmail) = 0 then Response.Write "You cannot submit details without submitting your email. Please pressrepparttar BACK button of your browser and try again."

AllOk = False

End If

If AllOk = True then

bText = "The visitor torepparttar 109627 web site has enteredrepparttar 109628 following details:" & Chr(13) & Chr(10) & Chr(13) & Chr(10)

' We userepparttar 109629 combination of Chr(13) and Chr(10) to insertrepparttar 109630 line breaks.

bText = bText & "Visitor's Name: " & nName & Chr(13) & Chr(10) bText = bText & "Visitor's Email: " & eEmail

' This section uses SMTP ' Sendingrepparttar 109631 email torepparttar 109632 webmaster.

Set Mailer = Server.CreateObject("SMTPsvg.Mailer) Mailer.FromAddress = eEmail Mailer.FromName = nName Mailer.AddRecipient "Webmaster", "" Mailer.RemoteHost = "" Mailer.Subject = "Form submitted at your web site!" Mailer.BodyText = bText

If Mailer.SendMail then Response.Redirect "thankyou.html" Else Response.Redirect "error.html" End If

Set Mailer = nothing

' This section uses CDONTS ' Sendingrepparttar 109633 email torepparttar 109634 webmaster.

Set Mailer = Server.CreateObject("CDONTS.NewMail") Mailer.From = eEmail Mailer.To = "" Mailer.Subject = Form submitted at your web site!" Mailer.Body = bText

If Mailer.Send then Response.Redirect "thankyou.html" Else Response.Redirect "error.html" End If

Set Mailer = nothing

End If


I have demonstrated both CDONTS and SMTP, but you have to use only one. You'll have to ask your web host what to use.

As usual, if you have a doubt, you can write to me at

Allrepparttar 109635 best.

Amrit Hallan is a freelance web designer. For all web site development and web promotion needs, you can get in touch with him at For more such articles, visit and You can subscribe to his newsletter [BYTESWORTH REACHOUT] on Web Designing Tips & Tricks by sending a blank email at

Do You Yahoo?

Written by Samuel Negron

Continued from page 1

D) Scroll torepparttar bottom ofrepparttar 109626 page to "Other Deliveries" and click onrepparttar 109627 last two no's Then click on "Save Changes".

It's unfortunate that a company as big and well known as Yahoo didn't findrepparttar 109628 time nor makerepparttar 109629 effort to contact its members to let them know they had sold them out. It's despicable!

I hope I have been of service.

To Your Success,

*************************** (You have permission to publish this article electronically or in print, free of charge, and freely distribute, as long asrepparttar 109630 bylines are included. (194 words) A courtesy copy of your publication would be appreciated. ***********************************

(c) 2002 by Samuel Negron Internet/Network Marketer Increase YOUR Response Rate by 2700%!!

    <Back to Page 1 © 2005
Terms of Use