I want to post form results to a database AND e-ma

Results 1 to 2 of 2

Thread: I want to post form results to a database AND e-ma

  1. #1
    Join Date
    Dec 1969
    Posts
    49

    Default I want to post form results to a database AND e-ma

    Hi- I&#039d like to use asp to post form results to an Access database but I&#039d like to e-mail the results also. Can I do this?

  2. #2
    Join Date
    Dec 1969
    Posts
    572

    Default RE: I want to post form results to a database AND

    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("yourvar") = 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><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
  •