View Single Post
Old 04-23-2007, 08:17 PM   #4 (permalink)
zkiller
Super Noob
 
zkiller's Avatar
 
Join Date: Aug 2004
Location: position:relative
Posts: 1,562
Send a message via AIM to zkiller Send a message via Yahoo to zkiller
Default

here is a decent tutorial explaining how to use the CDOSYS object.

http://hosting.fast-trak.net/tutoria...p_tutorial.htm

to automatically insert the email address the user submitted you do something like this...

1. i am gonna assume the email address field in the html form is called "email_address"

Code:
<%@ Language="VBSCRIPT" %>

<%
' declaring a variable

dim user_email_address

' setting the variable equal to the user submitted value

user_email_address = Request.Form("email_address")
now in below this bit of code you would put the code for the CDOSYS object as shown in the tutorial. this should look something like...

Code:
Dim MyMail
Set MyMail = Server.CreateObject("CDO.Message")
MyMail.From = "you@yourdomain.com"
MyMail.To = user_email_address
MyMail.Subject = "Thank you from YourDomain.com"
MyMail.TextBody = "Thank you for your participation... bla bla bla " &_
                          "bla bla bla"

MyMail.Fields("urn:schemas:httpmail:importance").Value = 2;
MyMail.Fields("http://schemas.microsoft.com/cdo/conf iguration/smtpserver") = "your smtp server"

' if your smtp server requires authentication add the following three lines

MyMail.Fields("http://schemas.microsoft.com/cdo/conf iguration/smtpauthenticate") = 1
MyMail.Fields("http://schemas.microsoft.com/cdo/conf iguration/sendusername") = "account name"
MyMail.Fields("http://schemas.microsoft.com/cdo/conf iguration/sendpassword") = "account password"

MyMail.Fields("http://schemas.microsoft.com/cdo/conf iguration/smtpserverport") = 25
MyMail.Fields.Update()
MyMail.Send()
Set MyMail = Nothing
and finally to redirect the user to your thank you page, unless you want them to see a blank page that is

Code:
Response.Redirect("thank_you_page.htm")
%>
hope that works for ya... let me know if you have any questions.
__________________
Stefan, the Post Master

Track Devil - May the boost be with you!
zkiller is offline   Reply With Quote