Code Bank
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
 
User Name:
Password:
Remember me
Go Back   ASP Free ForumsProgrammingCode Bank

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread ASP Free Forums Sponsor:
  #1  
Old September 23rd, 2004, 08:24 AM
johnpwiles johnpwiles is offline
Registered User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Sep 2004
Posts: 2 johnpwiles User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Help with email

I have a website that is password controlled, but the ASP script I have uses CDONTS to sent the "lost password" through a MS Access Database. I have tried and tried to modify it to use JMail or Bamboo and cannot get either to work. Does anyone have coding for sending the user via their email address, their password. The CDONTS code I cannot use is posted below. Any help would be great!

<%Response.Buffer=TRUE%>
<%
'here is the connection string
Set conn = server.createobject("adodb.connection")
'this connection uses JET 4 it is the prefered method of connecting to an access database
DSNtemp = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & Server.Mappath("database name and loc.")
'if you cant use JET then comment out the line above and uncomment the line below
'DSNtemp="DRIVER={Microsoft Access Driver (*.mdb)};DBQ=" & Server.Mappath("database name and loc.")
conn.Open DSNtemp
'here we are getting the info from the lost password form
uid = Request.Form("T1")
SQL = "Select * From users Where uid = '" & uid & "'"
Set RS = Conn.Execute(SQL)
'HERE WE CHECK TO MAKE SURE THE USERS EMAIL EXISTS, IF IT DOES, WE EMAIL IT
If NOT RS.EOF Then
Dim mytxt
'HERE YOU CAN ASSIGN ANY TEXT YOU LIKE TO GO IN THE EMAIL WITH THE PASSWORD, LEAVE IT IN THE QUOTES!!!
mytxt = "Here is your password:"
Dim ObjMail
Set ObjMail = Server.CreateObject("CDONTS.NewMail")
' if the email address exists then the info is sent here
ObjMail.To = RS("uid")
'############################### CHANGE THE EMAIL BELOW TO YOUR ADMIN EMAIL
'############################### leave it in the quotes!!!!!
Objmail.From = "johnpwiles@yahoo.com"
ObjMail.Subject = "Lost Password"
'HERE IS THE BODY SENDING PASSWORD
ObjMail.Body = mytxt & vbcrlf&_
RS("pwd")
ObjMail.Send
Set ObjMail = Nothing
x = "Your Password Will Be Sent To The Email Address You Are Registered With"
Else
'IF THE EMAIL DOES NOT EXIST WE TELL THE BELOW
x = "Sorry The Email Address You Entered Does Not Exist"
End If
%>
<html>
<head>
<title>Lost Password</title>
</head>
<body>
<center><%=x%></center>
</body>
</html>

Reply With Quote
  #2  
Old September 23rd, 2004, 09:13 AM
selwonk's Avatar
selwonk selwonk is offline
Contributing User
ASP Free Frequenter (2500 - 2999 posts)
 
Join Date: Jun 2004
Posts: 2,942 selwonk User rank is Second Lieutenant (5000 - 10000 Reputation Level)selwonk User rank is Second Lieutenant (5000 - 10000 Reputation Level)selwonk User rank is Second Lieutenant (5000 - 10000 Reputation Level)selwonk User rank is Second Lieutenant (5000 - 10000 Reputation Level)selwonk User rank is Second Lieutenant (5000 - 10000 Reputation Level)selwonk User rank is Second Lieutenant (5000 - 10000 Reputation Level)selwonk User rank is Second Lieutenant (5000 - 10000 Reputation Level) 
Time spent in forums: 6 Days 9 h 49 m 28 sec
Reputation Power: 62
Try changing this:
Code:
Set ObjMail = Server.CreateObject("CDONTS.NewMail")
' if the email address exists then the info is sent here
ObjMail.To = RS("uid")
'############################### CHANGE THE EMAIL BELOW TO YOUR ADMIN EMAIL
'############################### leave it in the quotes!!!!!
Objmail.From = "johnpwiles@yahoo.com"
ObjMail.Subject = "Lost Password"
'HERE IS THE BODY SENDING PASSWORD
ObjMail.Body = mytxt & vbcrlf&_
RS("pwd")
ObjMail.Send
Set ObjMail = Nothing
...to...
Code:
Set JMail = Server.CreateObject ("JMail.SMTPMail")
JMail.ServerAddress = "mail.yourdomain.com"
JMail.Sender = "johnpwiles@yahoo.com"
JMail.Subject = "Lost Password"
JMail.AddRecipient RS("uid")
JMail.Body = mytxt & vbcrlf&_
RS("pwd")
JMail.Priority = 3
JMail.Execute 
Set JMail = Nothing
__________________
selwonk

If I've posted some code above, you might think it looks a bit simplistic. It might be. I'd rather people tried the next step themselves rather than getting a full solution on a plate. That way they learn more!

Reply With Quote
Reply

Viewing: ASP Free ForumsProgrammingCode Bank > Help with email


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 3 hosted by Hostway