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

Send email and messages using a form

Status
Not open for further replies.

Guest_imported

New member
Jan 1, 1970
0
0
0

may i know how shall i send an email
using a form which include

email address: ________________
name: ________________
messages: ________________________________
________________________________

SUBMIT BUTTON

the question is:
how can i send this email using the email address filled
above just after i click the submit button...
 
DO you have CDONTS or ASPMail on the server? You will need some mail object installed to send email.

The rest is easy:
Code:
'example code for ASPMail
Set Mailer = Server.CreateObject("SMTPsvg.Mailer")

Mailer.FromName   = request.form("name")
Mailer.FromAddress= request.form("email")
Mailer.RemoteHost = "mail.yourdomain.com"
Mailer.AddRecipient "RecipientName", "RecipientEmail"
Mailer.Subject    = "Email Form"

bodyTxt = request.form("message")
Mailer.BodyText   = bodyTxt

if Mailer.SendMail then
  	response.redirect("showConfirmationPage.asp")
else
	response.write("Error & " & Mailer.Response)
End If
HTH
Kevin [sig][/sig]
 
Hi

How do install CDONTS &/or ASPMail?
Where can I get it from?

I have NT Server 4.
It's a pain to get the installation cd (we have site license) so if I get a place I can download it from I would appreciate it.

thank you for response
fred
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top