Johnnie,
I will give you some sample code. But this is for an Access database. It should not be hard to modify the code to work with SQL Server Database. I hope this helps.
Here's some sample code:
'Declare constants for a recordset that allows adding records
Const adLockOptimistic = 3
Const adOpenDynamic = 2
dim sqlString
dim connectionString, databaseName, Path
'Set connection details (add your connection details here)
'Set the sqlString (add your sql statement here)
'Create the recordset
set rs = Server.CreateObject("ADODB.Recordset")
rs.Open sqlString, connectionString, adOpenDynamic, adLockOptimistic
dim FirstName, LastName, Name
'Get values for new record from the form that the user submitted on the previous web page
FirstName = Request.Form("txtFirstName")
LastName = Request.Form("txtLastName")
Name = firstName & " " & lastName
rs.AddNew
rs("FirstName") = FirstName
rs("LastName") = LastName
'Fill in recordset field values, while converting all
'empty strings to Null values
rs("FirstName") = ConvertEmptyToNull(FirstName)
rs("LastName") = ConvertEmptyToNull(LastName)
'Save the record to the database for the first recordset
rs.Update
dim MyMail
Set MyMail = Server.CreateObject("CDONTS.NewMail")
EmailBody = "Name: " & Name & ""
MyMail.From = Name & "<" & Email & ">"
MyMail.To = "info@youremailaddress.com"
MyMail.Subject = "Hello"
MyMail.Body = EmailBody
MyMail.Send
set MyMail = Nothing
rs.Close
Set rs = Nothing