473,513 Members | 2,709 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Pull info from database than send that info via email?

Hey!

I have another script where i pull all the information from the database and I want to send it to the person. What they do is they enter in their email, and if the email matches, than it will email them their login information.

How do you grab the info and than use that info and put it into an email to send?

Here is my code thus far for it:

<%
Function SendEmail()

Dim myMail
Set myMail = CreateObject("CDONTS.NewMail")
HTML = "<!DOCTYPE HTML PUBLIC ""-//IETF//DTD HTML//EN"">" & NL
HTML = HTML & "<html>"
HTML = HTML & "<head>"
HTML = HTML & "<title>Login Information</title>"
HTML = HTML & "</head>"
HTML = HTML & "<center><b>Your Login Information</b></center>"
HTML = HTML & "<br>Dear: "
HTML = HTML & "<br><br>Here is your login information:"
HTML = HTML & "<br> <b>User Name: </b>"
HTML = HTML & "<br> <b>Password: </b>"
HTML = HTML & "<br><br> Please print this page for your records, and keep this information in a safe place. You can always check to see if there are any updates by going to that site. When there is an update available, we will send an email alerting you of this."
HTML = HTML & "<br><br> Thank you,"
HTML = HTML & "<br>3B Software Team"
HTML = HTML & "</body>"
HTML = HTML & "</html>"

myMail.From = "a@a.com"
myMail.To = Request.Form("email")
myMail.Subject = "Free Update Login Information"
myMail.BodyFormat = 0
myMail.MailFormat = 0
myMail.Body = HTML
myMail.Send

End Function
%>

<%
Response.Expires = -1000 'Make sure the browser doesnt cache this page
Response.Buffer = True 'enables our response.redirect to work

If Request.Form("valuepassed") ="true" Then
CheckSignUpForm
Else
ShowSignUpForm
End If
Sub CheckSignUpForm

Dim myconn, verify, blnLoggedIn, email, objRS
Set verify = Server.CreateObject("ADODB.Connection")
verify.open = "Provider=SQLOLEDB.1;Password=XXX;Persist Security Info=True;User ID=XXX;Initial Catalog=XXX;Data Source=XXX"

email = Request.Form("email")

Set objRS = verify.execute("SELECT id,ordernum, firstname, lastname, username, pass FROM regfreeup WHERE email='" & email & "';")
If objRS.EOF Then '''NO RECORDS MATCH. PROCEED WITH LOGIN CREATION
blnLoggedIn = False
Response.Redirect "http://www.microsoft.com"

Else '''EVERYTHING PASSED CHANGE EMAIL
blnLoggedIn = True
(no idea how to grab that info and put it into the email up top.)

SendEmail()
Response.Redirect "http://www.yahoo.com"
End If

verify.close
set verify = nothing

ShowSignUpForm
End Sub

%>

<% Sub ShowSignUpForm %>
form
<%end sub%>

Jul 19 '05 #1
1 1864
On Fri, 25 Jun 2004 08:39:54 -0700, "Kenshin"
<Ke*****@discussions.microsoft.com> wrote:
Hey!

I have another script where i pull all the information from the database and I want to send it to the person. What they do is they enter in their email, and if the email matches, than it will email them their login information.

How do you grab the info and than use that info and put it into an email to send?

Here is my code thus far for it:
First, do a Response.Write and make sure you're retrieving the info
correctly. To mail it, see:

http://www.aspfaq.com/show.asp?id=2119

Jeff
<%
Function SendEmail()

Dim myMail
Set myMail = CreateObject("CDONTS.NewMail")
HTML = "<!DOCTYPE HTML PUBLIC ""-//IETF//DTD HTML//EN"">" & NL
HTML = HTML & "<html>"
HTML = HTML & "<head>"
HTML = HTML & "<title>Login Information</title>"
HTML = HTML & "</head>"
HTML = HTML & "<center><b>Your Login Information</b></center>"
HTML = HTML & "<br>Dear: "
HTML = HTML & "<br><br>Here is your login information:"
HTML = HTML & "<br> <b>User Name: </b>"
HTML = HTML & "<br> <b>Password: </b>"
HTML = HTML & "<br><br> Please print this page for your records, and keep this information in a safe place. You can always check to see if there are any updates by going to that site. When there is an update available, we will send an email alerting you of this."
HTML = HTML & "<br><br> Thank you,"
HTML = HTML & "<br>3B Software Team"
HTML = HTML & "</body>"
HTML = HTML & "</html>"

myMail.From = "a@a.com"
myMail.To = Request.Form("email")
myMail.Subject = "Free Update Login Information"
myMail.BodyFormat = 0
myMail.MailFormat = 0
myMail.Body = HTML
myMail.Send

End Function
%>

<%
Response.Expires = -1000 'Make sure the browser doesnt cache this page
Response.Buffer = True 'enables our response.redirect to work

If Request.Form("valuepassed") ="true" Then
CheckSignUpForm
Else
ShowSignUpForm
End If
Sub CheckSignUpForm

Dim myconn, verify, blnLoggedIn, email, objRS
Set verify = Server.CreateObject("ADODB.Connection")
verify.open = "Provider=SQLOLEDB.1;Password=XXX;Persist Security Info=True;User ID=XXX;Initial Catalog=XXX;Data Source=XXX"

email = Request.Form("email")

Set objRS = verify.execute("SELECT id,ordernum, firstname, lastname, username, pass FROM regfreeup WHERE email='" & email & "';")
If objRS.EOF Then '''NO RECORDS MATCH. PROCEED WITH LOGIN CREATION
blnLoggedIn = False
Response.Redirect "http://www.microsoft.com"

Else '''EVERYTHING PASSED CHANGE EMAIL
blnLoggedIn = True
(no idea how to grab that info and put it into the email up top.)

SendEmail()
Response.Redirect "http://www.yahoo.com"
End If

verify.close
set verify = nothing

ShowSignUpForm
End Sub

%>

<% Sub ShowSignUpForm %>
form
<%end sub%>


Jul 19 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
2488
by: cvillard | last post by:
I am new to SQL, as old as it is. I am not new to programming I normally just use Access. I have two tables for a little project manager I made. After updates I sent an email to the user. I need...
5
7216
by: Julia Baresch | last post by:
Hi everyone, I haven't found any reference to this problem on this group or in Access 97 help. I hope someone here knows this - probably a simple thing, but not obvious. I designed a query to...
12
6271
by: chadlupkes | last post by:
I've been trying to create a simple (I hope) PHP application to send emails to a membership list. I have yet to successfully connect to my database to pull the names and email addresses. I'm...
4
1431
by: comp_guy | last post by:
hey guys, can anyone see where im going wrong in my code below? i am making a registration form on a webpage before using php to send the input data into a mySQL database. first off is the code for...
5
1759
by: The Cool Geek | last post by:
I'm building a dynamic site that has 3 data bases. One DB contains all of my store info ID#, Name, Address, Phone. Another DB contains member info ID, Name, address, email,phone,etc... The 3rd DB...
0
2232
by: ArtDerailed | last post by:
Hello there, I too am having a somewhat similar problem and would very much appreciate some assistance. Through PHP, I have already set up my Flash actionscript to pass info and variables onto a...
4
1915
by: sparks | last post by:
We have a new project here, one that I have never tried maybe its easy I don't know yet. We have people that have records dating back over 5 yrs on a sql server. We have to build an access 2003...
1
3969
by: SkipNRun | last post by:
I am a novice when comes to JavaScript, AJAX. I am working on a form, which will allow users to update their contact information. In order to make the form flexible, I need to use pull down list. ...
6
1846
by: HughMcMenamin | last post by:
Hi All ~ First time posting. I have a module that works ... it contains: Set objCDOMessage = CreateObject("CDO.Message") With objCDOMessage Set .Configuration = objCDOConfig .From = "PSS...
0
7254
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
7153
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
7432
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
7094
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
5677
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
5079
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
4743
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
1585
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
0
452
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.