Mail form results and store it in database

Results 1 to 4 of 4

Thread: Mail form results and store it in database

  1. #1
    xiuping Guest

    Default Mail form results and store it in database

    i want to have a user fill out a form, and have the results automatically emailed to the corresponding receiver also at the same time the results will store in a database, how to go about it?<BR><BR>thanx in advance

  2. #2
    Join Date
    Dec 1969
    Posts
    2,849

    Default RE: Mail form results and store it in database

    Check out this article:<BR><BR>Mailing Form Results<BR>http://www.4guysfromrolla.com/webtech/071599-1.shtml<BR><BR>This shows how to automatically send all of the results a user entered into a form via CDONTS.

  3. #3
    LoriTC Guest

    Default RE: Mail form results and store it in database

    This example only shows how to send the email address it does not show how to add the data to a database. I am looking for the same info if anyone has it.

  4. #4
    Join Date
    Dec 1969
    Posts
    572

    Default RE: Mail form results and store it in database

    Yes, you can do whatever you want with your variables after you got them from<BR>Request.Form("yourvar")or Request.QueryString("yourvar")<BR>depends on form METHOD you used.<BR>Then you can add them to db like that:<BR><BR>&#060;% set conn=server.createobject("adodb.Recordset")<BR>con n.ActiveConnection = "mydb"<BR>conn.Source = "table"<BR>conn.CursorType = 3 <BR>conn.LockType = 2 <BR>conn.Open<BR>conn.AddNew<BR>conn.Fields("yourv ar") = you<BR>conn. Update<BR>conn.close<BR>set conn=nothing%&#062;<BR>Then you can send email using CDO or any third part objects.<BR>For CDO:<BR>&#060;%<BR>Set oMailMessage = CreateObject("CDONTS.NewMail") <BR>&#039 Send an email to to@somewhere.com from from@somewhere.com<BR>oMailMessage.from = <BR>oMailMessage.to = <BR>oMailMessage.subject =<BR>cont= yourvar<BR>cont= cont & "Thank you!"<BR>oMailMessage.Body = cont<BR>oMailMessage.Send()<BR>&#039 Release the NewMail object<BR>Set oMailMessage = Nothing &#039 Release the object<BR>%&#062;<BR>


Posting Permissions

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