Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

Send Email after Insert Record

Guest
Mar 11, 2007 Mar 11, 2007
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. thnaks
TOPICS
Server side applications
480
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Mar 12, 2007 Mar 12, 2007
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
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guest
Mar 12, 2007 Mar 12, 2007
I found a tutoiral similiar and for kicks I tried it and it worked. But what I really want to do not to be a pain is to send the email on a second asp page with other script unlsess you can help me figure out how to do it all on the same page.
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Mar 12, 2007 Mar 12, 2007
LATEST
On 12 Mar 2007 in macromedia.dreamweaver.appdev, jeremy12345 wrote:

> I found a tutoiral similiar and for kicks I tried it and it worked.
> But what I really want to do not to be a pain is to send the email
> on a second asp page with other script unlsess you can help me
> figure out how to do it all on the same page.

<%
' Code to enter record into database goes here
' ...
%>
<%
' Code to send email goes here
' ...
%>
<!-- HTML Code, if any, goes here -->

--
Joe Makowiec
http://makowiec.net/
Email: http://makowiec.net/email.php
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines