logo-dw

Go Back   Dreamweaver Club Forums > Hand Coders Forum > ASP
Register FAQ Members List Search Today's Posts Mark Forums Read

Reply
 
Thread Tools Display Modes
Old 01-22-2010, 08:14 PM   #1
thinkdolphin
 
Join Date: Aug 2009
Posts: 4
Question Sending an email from Insert Record

Can anyone tell me what to do to send an email with info from the Insert Record form to an email address? But JUST certain fields, not the whole form so there will be exclusions.

Here is the generated code:

Code:
<!--#include file="../Connections/Comm_Choice.asp" -->
<%
// *** Edit Operations: declare variables
// set the form action variable
var MM_editAction = Request.ServerVariables("SCRIPT_NAME");
if (Request.QueryString) {
  MM_editAction += "?" + Server.HTMLEncode(Request.QueryString);
}
// boolean to abort record edit
var MM_abortEdit = false;
%>
<%
if (String(Request("MM_insert")) == "form1") {
  if (!MM_abortEdit) {
    // execute the insert
 
    var MM_editCmd = Server.CreateObject ("ADODB.Command");
    MM_editCmd.ActiveConnection = MM_Comm_Choice_STRING;
    MM_editCmd.CommandText = "INSERT INTO Entertainment (All_Around, Bagels, Bakery, Bar, BBQ, Beer, Bingo, Breakfast, Brunch, Buffet, Burger, Cake, Candy, Chicken, Chinese, Coffee_Shop, Cookies, Comedy, Coffee_Cup, Dance, Deli, Delivery, Dessert, Dinner, Dinner_10, Donuts, Fast_Food, Fastest_Lunch, Happy_Hour, Healthy_Food, Hoagie, Hotdog, Ice_Cream, Italian, Japanese, Lunch_Delivered, Lunch_Spot, Mediterranean, Mexican, Night_Spot, Pizza_Chain, Pizza_Nonchain, Rest_Atmosphere, Ribs, Romantic, Spaghetti, Sports_Bar, Steakhouse, Wings, Your_Name, Your_Address, Your_City, Your_State, Your_Phone, Your_Email, Your_Age, Subscriber) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)";
    MM_editCmd.Prepared = true;
    MM_editCmd.Parameters.Append(MM_editCmd.CreateParameter("param1", 202, 1, 255, Request.Form("All_Around"))); // adVarWChar
    MM_editCmd.Parameters.Append(MM_editCmd.CreateParameter("param2", 202, 1, 255, Request.Form("Bagels"))); // adVarWChar
    MM_editCmd.Parameters.Append(MM_editCmd.CreateParameter("param3", 202, 1, 255, Request.Form("Bakery"))); // adVarWChar
    MM_editCmd.Parameters.Append(MM_editCmd.CreateParameter("param4", 202, 1, 255, Request.Form("Bar"))); // adVarWChar
    MM_editCmd.Parameters.Append(MM_editCmd.CreateParameter("param5", 202, 1, 255, Request.Form("BBQ"))); // adVarWChar
    MM_editCmd.Parameters.Append(MM_editCmd.CreateParameter("param6", 202, 1, 255, Request.Form("Beer"))); // adVarWChar
    MM_editCmd.Parameters.Append(MM_editCmd.CreateParameter("param7", 202, 1, 255, Request.Form("Bingo"))); // adVarWChar
    MM_editCmd.Parameters.Append(MM_editCmd.CreateParameter("param8", 202, 1, 255, Request.Form("Breakfast"))); // adVarWChar
    MM_editCmd.Parameters.Append(MM_editCmd.CreateParameter("param9", 202, 1, 255, Request.Form("Brunch"))); // adVarWChar
    MM_editCmd.Parameters.Append(MM_editCmd.CreateParameter("param10", 202, 1, 255, Request.Form("Buffet"))); // adVarWChar
    MM_editCmd.Parameters.Append(MM_editCmd.CreateParameter("param11", 202, 1, 255, Request.Form("Burger"))); // adVarWChar
    MM_editCmd.Parameters.Append(MM_editCmd.CreateParameter("param12", 202, 1, 255, Request.Form("Cake"))); // adVarWChar
    MM_editCmd.Parameters.Append(MM_editCmd.CreateParameter("param13", 202, 1, 255, Request.Form("Candy"))); // adVarWChar
    MM_editCmd.Parameters.Append(MM_editCmd.CreateParameter("param14", 202, 1, 255, Request.Form("Chicken"))); // adVarWChar
    MM_editCmd.Parameters.Append(MM_editCmd.CreateParameter("param15", 202, 1, 255, Request.Form("Chinese"))); // adVarWChar
    MM_editCmd.Parameters.Append(MM_editCmd.CreateParameter("param16", 202, 1, 255, Request.Form("Coffee_Shop"))); // adVarWChar
    MM_editCmd.Parameters.Append(MM_editCmd.CreateParameter("param17", 202, 1, 255, Request.Form("Cookies"))); // adVarWChar
    MM_editCmd.Parameters.Append(MM_editCmd.CreateParameter("param18", 202, 1, 255, Request.Form("Comedy"))); // adVarWChar
    MM_editCmd.Parameters.Append(MM_editCmd.CreateParameter("param19", 202, 1, 255, Request.Form("Coffee_Cup"))); // adVarWChar
    MM_editCmd.Parameters.Append(MM_editCmd.CreateParameter("param20", 202, 1, 255, Request.Form("Dance"))); // adVarWChar
    MM_editCmd.Parameters.Append(MM_editCmd.CreateParameter("param21", 202, 1, 255, Request.Form("Deli"))); // adVarWChar
    MM_editCmd.Parameters.Append(MM_editCmd.CreateParameter("param22", 202, 1, 255, Request.Form("Delivery"))); // adVarWChar
    MM_editCmd.Parameters.Append(MM_editCmd.CreateParameter("param23", 202, 1, 255, Request.Form("Dessert"))); // adVarWChar
    MM_editCmd.Parameters.Append(MM_editCmd.CreateParameter("param24", 202, 1, 255, Request.Form("Dinner"))); // adVarWChar
    MM_editCmd.Parameters.Append(MM_editCmd.CreateParameter("param25", 202, 1, 255, Request.Form("Dinner_10"))); // adVarWChar
    MM_editCmd.Parameters.Append(MM_editCmd.CreateParameter("param26", 202, 1, 255, Request.Form("Donuts"))); // adVarWChar
    MM_editCmd.Parameters.Append(MM_editCmd.CreateParameter("param27", 202, 1, 255, Request.Form("Fast_Food"))); // adVarWChar
    MM_editCmd.Parameters.Append(MM_editCmd.CreateParameter("param28", 202, 1, 255, Request.Form("Fastest_Lunch"))); // adVarWChar
    MM_editCmd.Parameters.Append(MM_editCmd.CreateParameter("param29", 202, 1, 255, Request.Form("Happy_Hour"))); // adVarWChar
    MM_editCmd.Parameters.Append(MM_editCmd.CreateParameter("param30", 202, 1, 255, Request.Form("Healthy_Food"))); // adVarWChar
    MM_editCmd.Parameters.Append(MM_editCmd.CreateParameter("param31", 202, 1, 255, Request.Form("Hoagie"))); // adVarWChar
    MM_editCmd.Parameters.Append(MM_editCmd.CreateParameter("param32", 202, 1, 255, Request.Form("Hotdog"))); // adVarWChar
    MM_editCmd.Parameters.Append(MM_editCmd.CreateParameter("param33", 202, 1, 255, Request.Form("Ice_Cream"))); // adVarWChar
    MM_editCmd.Parameters.Append(MM_editCmd.CreateParameter("param34", 202, 1, 255, Request.Form("Italian"))); // adVarWChar
    MM_editCmd.Parameters.Append(MM_editCmd.CreateParameter("param35", 202, 1, 255, Request.Form("Japanese"))); // adVarWChar
    MM_editCmd.Parameters.Append(MM_editCmd.CreateParameter("param36", 202, 1, 255, Request.Form("Lunch_Delivered"))); // adVarWChar
    MM_editCmd.Parameters.Append(MM_editCmd.CreateParameter("param37", 202, 1, 255, Request.Form("Lunch_Spot"))); // adVarWChar
    MM_editCmd.Parameters.Append(MM_editCmd.CreateParameter("param38", 202, 1, 255, Request.Form("Mediterranean"))); // adVarWChar
    MM_editCmd.Parameters.Append(MM_editCmd.CreateParameter("param39", 202, 1, 255, Request.Form("Mexican"))); // adVarWChar
    MM_editCmd.Parameters.Append(MM_editCmd.CreateParameter("param40", 202, 1, 255, Request.Form("Night_Spot"))); // adVarWChar
    MM_editCmd.Parameters.Append(MM_editCmd.CreateParameter("param41", 202, 1, 255, Request.Form("Pizza_Chain"))); // adVarWChar
    MM_editCmd.Parameters.Append(MM_editCmd.CreateParameter("param42", 202, 1, 255, Request.Form("Pizza_Nonchain"))); // adVarWChar
    MM_editCmd.Parameters.Append(MM_editCmd.CreateParameter("param43", 202, 1, 255, Request.Form("Rest_Atmosphere"))); // adVarWChar
    MM_editCmd.Parameters.Append(MM_editCmd.CreateParameter("param44", 202, 1, 255, Request.Form("Ribs"))); // adVarWChar
    MM_editCmd.Parameters.Append(MM_editCmd.CreateParameter("param45", 202, 1, 255, Request.Form("Romantic"))); // adVarWChar
    MM_editCmd.Parameters.Append(MM_editCmd.CreateParameter("param46", 202, 1, 255, Request.Form("Spaghetti"))); // adVarWChar
    MM_editCmd.Parameters.Append(MM_editCmd.CreateParameter("param47", 202, 1, 255, Request.Form("Sports_Bar"))); // adVarWChar
    MM_editCmd.Parameters.Append(MM_editCmd.CreateParameter("param48", 202, 1, 255, Request.Form("Steakhouse"))); // adVarWChar
    MM_editCmd.Parameters.Append(MM_editCmd.CreateParameter("param49", 202, 1, 255, Request.Form("Wings"))); // adVarWChar
    MM_editCmd.Parameters.Append(MM_editCmd.CreateParameter("param50", 202, 1, 255, Request.Form("Your_Name"))); // adVarWChar
    MM_editCmd.Parameters.Append(MM_editCmd.CreateParameter("param51", 202, 1, 255, Request.Form("Your_Address"))); // adVarWChar
    MM_editCmd.Parameters.Append(MM_editCmd.CreateParameter("param52", 202, 1, 255, Request.Form("Your_City"))); // adVarWChar
    MM_editCmd.Parameters.Append(MM_editCmd.CreateParameter("param53", 202, 1, 255, Request.Form("Your_State"))); // adVarWChar
    MM_editCmd.Parameters.Append(MM_editCmd.CreateParameter("param54", 202, 1, 255, Request.Form("Your_Phone"))); // adVarWChar
    MM_editCmd.Parameters.Append(MM_editCmd.CreateParameter("param55", 202, 1, 255, Request.Form("Your_Email"))); // adVarWChar
    MM_editCmd.Parameters.Append(MM_editCmd.CreateParameter("param56", 5, 1, -1, (String(Request.Form("Your_Age")) != "undefined" && String(Request.Form("Your_Age")) != "") ? Request.Form("Your_Age") : null)); // adDouble
    MM_editCmd.Parameters.Append(MM_editCmd.CreateParameter("param57", 202, 1, 255, Request.Form("Subscriber"))); // adVarWChar
    MM_editCmd.Execute();
    MM_editCmd.ActiveConnection.Close();
    // append the query string to the redirect URL
    var MM_editRedirectUrl = "thankyou.html";
    if (MM_editRedirectUrl && Request.QueryString && Request.QueryString.Count > 0) {
      MM_editRedirectUrl += ((MM_editRedirectUrl.indexOf('?') == -1) ? "?" : "&") + Request.QueryString;
    }
    Response.Redirect(MM_editRedirectUrl)
  }
}
%>
TIA!
Dahn
thinkdolphin is offline   Reply With Quote
Old 07-07-2010, 02:19 AM   #2
edbr
edbr's Avatar
 
Join Date: Aug 2005
Location: Bali
Posts: 11,169
Default

i dont know my ASP from my elbow, but you will need a mail sending script . you will have to yahoogle for one i imagine
__________________
If you're happy and you know it shake your meds!
different style links examples

Flight / Hotel search
Free script download
Bali Villas
edbr is offline   Reply With Quote
Old 08-17-2010, 01:57 PM   #3
gigiloumill
gigiloumill's Avatar
 
Join Date: Apr 2009
Location: Miami, FL
Posts: 493
Default

Search for a mailing script and leave the fields you don't want out.
gigiloumill is offline   Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 08:59 PM.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2017, vBulletin Solutions, Inc.
Copyright 2006 DreamweaverClub.com