Wrox Programmer Forums
|
Classic ASP Databases Discuss using ASP 3 to work with data in databases, including ASP Database Setup issues from the old P2P forum on this specific subtopic. See also the book forum Beginning ASP.NET Databases for questions specific to that book. NOT for ASP.NET 1.0, 1.1, or 2.0.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Classic ASP Databases section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old August 23rd, 2005, 01:32 PM
Authorized User
 
Join Date: Aug 2005
Posts: 10
Thanks: 0
Thanked 0 Times in 0 Posts
Default Sending email from asp page

Do anyone know how to send a confirmation email from an asp webpage? Or do you know the code for getting the email address that was given and send a email back to that person? The reason is I have a guestbook on my website that that send the information to my database and i wanted to know how to get that email address that the user entered and send them a email thanking them for there comments. If anyone have a small clue on how this is done can i please get a pointer.

Thank You :)
 
Old August 24th, 2005, 11:13 AM
Authorized User
 
Join Date: Jul 2005
Posts: 59
Thanks: 0
Thanked 0 Times in 0 Posts
Default

If you wanna email with asp, try the following:

Set yourEmail=Server.CreateObject("CDO.Message")

With yourEmail
   .Subject=theSubject
   .From= "yourEmailAddress@yourDomain"
   .To = "yourGuestBookReader@theirDomain"
   .TextBody= "thank you. .blah blah blah ... "
   .Send
End With

set yourMail=nothing

I personally email as soon as the database insert is finished. So, there's no need to get the email from database.

 
Old August 24th, 2005, 02:14 PM
Authorized User
 
Join Date: Aug 2005
Posts: 10
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Thank You:)
But do this send it to the person sending the e-mail or do it send an auto email

 
Old August 24th, 2005, 03:00 PM
Authorized User
 
Join Date: Jul 2005
Posts: 59
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Sorry. I don't understand

Anyway this block of code can invoke the email procedure.
Or what exactly do you wanna do?

 
Old August 24th, 2005, 05:07 PM
Authorized User
 
Join Date: Aug 2005
Posts: 10
Thanks: 0
Thanked 0 Times in 0 Posts
Default

I just want to capture the e-mail address and send a thank you expression.

I think the code may help
Thanks alot

 
Old August 25th, 2005, 11:25 AM
Friend of Wrox
 
Join Date: Jul 2003
Posts: 599
Thanks: 6
Thanked 3 Times in 3 Posts
Default

Yes, g2000 gave you the code for that.

I don't know if this is what you mean but capture the email address with using a form and on the post page:

[form page]
<form name="guest" action="guest_process.asp" method="post">
Email Address: <input type="text" name="ReaderEmailAddress"><br>
<input type="submit" value="Submit">
</form>

[post page]
<%
    varReaderEmailAddress = Request("ReaderEmailAddress")

    Set yourEmail=Server.CreateObject("CDO.Message")

   yourEmail.Subject=theSubject
   yourEmail.From= "yourEmailAddress@yourDomain"
   yourEmail.To = varReaderEmailAddress
   yourEmail.TextBody= "thank you. .blah blah blah blig blig blam bodzoi... "
   yourEmail.Send
   set yourMail=nothing
   Response.Write "Thank you email sent to: " & varReaderEmailAddress
%>

This code works but unfortunately it doesn't work at my house since my ISP doesn't allow email being sent from other domains through their mail server.



 
Old August 25th, 2005, 01:05 PM
Authorized User
 
Join Date: Aug 2005
Posts: 10
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Well, Thank You! :)
I hope this works.






Similar Threads
Thread Thread Starter Forum Replies Last Post
Sending Email with ASP.NET stu9820 ASP.NET 1.0 and 1.1 Basics 19 February 9th, 2007 03:50 AM
sending email through asp.net amol.mahajan85@gmail.com .NET Framework 1.x 2 October 19th, 2006 12:13 PM
sending Email thru ASP Code zaeem Classic ASP Basics 4 November 13th, 2003 04:03 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.