dcsimg
www.webdeveloper.com
Results 1 to 3 of 3

Thread: Automated Email Don't Have A Clue

  1. #1
    Join Date
    Feb 2003
    Location
    Sault Ste Marie, On, Canada
    Posts
    168

    Question Automated Email Don't Have A Clue

    REMEMBER WHEN YOU REGISTERED YOU GOT AN AUTO RESPONSE EMAIL, CAN SOMEONE HELP ME WITH HOW TO DO IT, SOME EXAMPLE CODE WOULD BE GREAT TOO, THE USER WILL REGISTER AND THE FORM CONTENTS WILL BE INSERTED INTO AN ACCESS DATABASE AND I WANT AN AUTO RESPONSE EMAIL SENT TO THEM BASED ON THE EMAIL ADDRESS THEY FILLED OUT ON THE FORM WHICH WAS ON THE LIST.
    Last edited by Calmaris; 02-07-2003 at 02:06 PM.

  2. #2
    Join Date
    Jan 2003
    Location
    Dundee, Scotland
    Posts
    1,367
    hi,
    hope this helps:

    <%@LANGUAGE="VBSCRIPT" CODEPAGE="1252"%>
    <html>
    <head>
    <title>Untitled Document</title>
    <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
    </head>

    <body>
    <%
    '------------------this is an if statment for postback--------------------
    val = request.form("val")
    if val = "" then
    '-----------------this is the form--------------------------------------
    %>
    <form action="thankyou.asp" method="get">
    <table width="90%" border="0" cellspacing="0" cellpadding="4">
    <tr>
    <td>Name:</td>
    <td><input name="t1" type="text" id="t1"></td>
    </tr>
    <tr>
    <td>Email:</td>
    <td><input name="t2" type="text" id="t2"></td>
    </tr>
    <tr>
    <td>Password:</td>
    <td><input name="Password" type="password" id="Password"></td>
    </tr>
    <tr>
    <td>Message:</td>
    <td><textarea name="sl" id="sl"></textarea></td>
    </tr>
    <tr>
    <td> </td>
    <td><input type="submit" name="Submit" value="Submit">
    <input name="val" type="hidden" id="val" value="yes"></td>
    </tr>
    </table>

    </form>
    <%
    '----------------if the form has been submitted to its self then run this code-------------------
    else
    '--------------------request the form elements and write to variables----------------------
    t1 = Request.Form("t1")
    t2 = Request.Form("t2")
    st = Request.Form("s1")
    yourpassword = request.form("password")
    Dim ObjMail
    '-------------------setup the CDONTS email object-------------------------------------
    Set ObjMail = Server.CreateObject("CDONTS.NewMail")
    '------------------------Set the email elements------------------------------
    ObjMail.To = ""&t2&""
    ObjMail.CC = ""&t2&""
    ObjMail.From = "mybox@aol.com"
    ObjMail.Subject = "You have registered"
    thebody = "Name:"&t1&"" & vbcrlf
    '----------------create the body of the message------------------------
    thebody = thebody & "Email: "&t2&"" & vbclf
    thebody = thebody & "Subject: "&t3&""
    ObjMail.Body = thebody
    '----------------------send the message-----------------------------------
    ObjMail.Send
    Set ObjMail = Nothing
    '---------------------insert the information intot he database------------------------
    sqltext = "INSERT INTO tblMembers (MemberName, MemberPassword "
    sqltext = sqltext & " VALUES ("&t1&", "&yourpassword&")"
    set RS = yourdatasource.Execute(sqltext)

    set RS = nothing
    '---------------------insert your thankyou message here------------------
    %>
    <table width="90%" border="0" cellspacing="0" cellpadding="4">
    <tr>
    <td>Thank you <%=t1%></td>
    </tr>
    </table>
    <%
    '----------------------end if the if statement----------------------------
    end if

    %>

  3. #3
    Join Date
    Feb 2003
    Location
    Sault Ste Marie, On, Canada
    Posts
    168
    Hey thanks alot, I really appreciate the help on this. LoL I would love to try it but my SQL server got the slammer virus and I have to reinstall it and reconfigure a bunch of crap. I'll post another thread if I run into any trouble.

    Thanks

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center



Recent Articles