Emailing form results

Results 1 to 2 of 2

Thread: Emailing form results

  1. #1
    Join Date
    Dec 1969
    Posts
    1,013

    Default Emailing form results

    Got some good ideas from one of the articles here entitled "Mailing Form results" which uses CDO to send the results of a form. The problem is I can&#039t get the results to show up in a particular order. I want to send the results to others as well as myself so I&#039d like the order of the list to make some sense. Thanks for the help.

  2. #2
    Jason Buck Guest

    Default RE: Emailing form results

    If you are pull the name you want to send to from a database,<BR><BR>All you have to do is create a form with a textarea. Post the form to the following page and I will send the textarea contents to all of the email addresses in the db.<BR><BR>I hope this helps. Respectfully, Jason webmaster@wnj.com<BR>&#039********************CODE BELOW<BR>&#060;%@ LANGUAGE=VBSCRIPT %&#062;<BR>&#060;html&#062;<BR><BR>&#060;head&#062 ;<BR>&#060;title&#062;Sending Your Email Message&#060;/title&#062;<BR>&#060;style&#062; <BR>BODY {font-family:"Arial"; font-size:12; font-weight:normal}<BR>.intro {font-family:"Arial"; font-size:14; font-weight:bold} <BR>&#060;/style&#062;<BR>&#060;/head&#062;<BR><BR>&#060;body&#062;<BR><BR>&#060;%< BR>strmailmsg = request.form("mailmsg")<BR>strdbmailmsg = replace(strmailmsg, "&#039", "&#039&#039")<BR><BR><BR>strConnect = "Driver={Microsoft Access Driver (*.mdb)}; DBQ=C:databasemailer.mdb"<BR><BR>dim objconn, objrec, mysql, strStatus, Mytest, strLength<BR>set objconn = server.createobject("ADODB.Connection")<BR><BR><BR >objConn.open strConnect<BR><BR><BR>mysql = "SELECT tbleMail.emailaddress, tbleMail.emailname FROM tbleMail ORDER BY emailaddress;"<BR><BR><BR><BR><BR>set rstemp=objConn.execute(mysql)<BR><BR><BR><BR>If not rstemp.eof then<BR><BR> Do While Not rstemp.EOF<BR><BR><BR> <BR> <BR>strename = rstemp("emailname")<BR><BR>strTo = rstemp("emailaddress") &#039get message strings from Request <BR>strFrom = "Client" <BR>strSubject = "Bulk Email"<BR>strBody = strmailmsg<BR><BR>Response.Write "Sending email to: &#060;B&#062;" & strename & "&#060;/B&#062; .. <BR>"<BR><BR>Set objMail = Server.CreateObject("CDONTS.Newmail")<BR>objMail.T o = strTo &#039set &#039To&#039 address<BR>objMail.From = strFrom &#039set &#039From&#039 address<BR>objMail.Value("Reply-To") = strFrom &#039set &#039Reply to&#039 address<BR>objMail.Subject = strSubject &#039set the subject line<BR>objMail.Body = strBody &#039set the message content<BR>objMail.Send &#039and send the message<BR>Set objMail = Nothing &#039then destroy the component<BR><BR> rstemp.movenext<BR><BR>Loop<BR><BR>End if<BR><BR><BR> rstemp.close<BR> <BR><BR>Set rstemp = nothing<BR>objConn.close<BR>Set objConn = nothing<BR><BR>%&#062;<BR><BR><BR><BR><BR>&#060;/p&#062;<BR>&#060;/body&#062;<BR>&#060;/html&#062;<BR><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
  •