On 11 Mar 2007 in macromedia.dreamweaver.appdev, jeremy12345
wrote:
> I am by no means a coder so please be gental. I have a
contact page
> that I have insert into a database, but I am also trying
to send an
> email after it inserts into the db. But I cant seem how
to make it
> work. Dreamweaver wrote the code for the insert and I am
not sure
> were to go from here. I am using asp vb.
See all those Request.Form("nameSuffix") and similar? They
contain the
information posted from the form, and are still available to
you after
the database has been populated.
What you need to do:
- Find out from your hosting provider what mail component(s)
are
available on your server.
- Create an email using the information from the form:
<%
DIM MyEMailBody, MyEMail
MyEMailBody = "Name: " & Request.Form("nameFirst") &
" "
MyEMailBody = MyEMailBody & Request.Form("nameMiddle")
& " "
MyEMailBody = MyEMailBody & Request.Form("nameLast")
& VBCrLf
' VBCrLf is a CarriageReturn/LineFeed (ie a new line)
' ...
' Details Below will vary depending on the mailer component
MyEMail = CreateObject("CDONTS.NewMail")
MyEMail.From = "webform@example.com"
MyEMail.To = "jeremy12345@example.com"
MyEMail.Subject = "Inserted Record"
MyEMail.Body = MyEMailBody
' Send the email
MyEMail.Send
' Get rid of the email on the server
SET MyEMail = nothing
%>
--
Joe Makowiec
http://makowiec.net/
Email:
http://makowiec.net/email.php