<%
Dim myMail,HTML,msg
dim dbn
dbn="../yourdbpath/Database.mdb"
ID = Request("ID")
fromAddress = Request.Form("fromAddress")
Set cn = Server.CreateObject("ADODB.Connection")
cn.provider="microsoft.jet.oledb.4.0"
cn.connectionstring=server.mappath(dbn)
cn.open
'cn.Open cstring
q = "SELECT * FROM users WHERE userid LIKE '" & fromAddress & "'"
Set rs = cn.Execute(q)
if rs.EOF then
Response.write "<font color=""brown"" >Sorry! You have entered wrong Email Address or Email address not in the list. </font>"
else
password=rs("password")
msg = "User password helper! " & chr(10) & chr(10)
msg = msg & "Please Use below password to login to user area " & Title & chr(10)
msg = msg & "EmailAddress: " & fromAddress & chr(10)
msg = msg & "Password: " & password & chr(10)
Set myMail = Server.CreateObject("CDO.Message")
Dim cdoConfig
Set cdoConfig = myMail.Configuration
With cdoConfig.Fields
.Item("http://schemas.microsoft.com/cdo/configuration/sendusing") = 2
.Item("http://schemas.microsoft.com/cdo/configuration/smtpserver") = "mail.server.com"
.Item("http://schemas.microsoft.com/cdo/configuration/smtpserverport") = 25
'*** Authentication ***'
.Item ("http://schemas.microsoft.com/cdo/configuration/smtpauthenticate") = 1
.Item ("http://schemas.microsoft.com/cdo/configuration/sendusername") = "username" '*** User ***'
.Item ("http://schemas.microsoft.com/cdo/configuration/sendpassword") = "password" '*** Password ***'
.Item ("http://schemas.microsoft.com/cdo/configuration/smtpconnectiontimeout") = 30
.Update
End With
myMail.Configuration = cdoConfig
myMail.From = "from@site.com"
myMail.To = fromAddress
myMail.Subject = "User password !"
myMail.HTMLBody = msg
myMail.Send
Set myMail = Nothing
Response.write "<font color=""brown"" >Your pasword has been sent to your Email Address.. Pls check after some time. In case any problem Please contact the administrator </font>"
end if
%>
Dim myMail,HTML,msg
dim dbn
dbn="../yourdbpath/Database.mdb"
ID = Request("ID")
fromAddress = Request.Form("fromAddress")
Set cn = Server.CreateObject("ADODB.Connection")
cn.provider="microsoft.jet.oledb.4.0"
cn.connectionstring=server.mappath(dbn)
cn.open
'cn.Open cstring
q = "SELECT * FROM users WHERE userid LIKE '" & fromAddress & "'"
Set rs = cn.Execute(q)
if rs.EOF then
Response.write "<font color=""brown"" >Sorry! You have entered wrong Email Address or Email address not in the list. </font>"
else
password=rs("password")
msg = "User password helper! " & chr(10) & chr(10)
msg = msg & "Please Use below password to login to user area " & Title & chr(10)
msg = msg & "EmailAddress: " & fromAddress & chr(10)
msg = msg & "Password: " & password & chr(10)
Set myMail = Server.CreateObject("CDO.Message")
Dim cdoConfig
Set cdoConfig = myMail.Configuration
With cdoConfig.Fields
.Item("http://schemas.microsoft.com/cdo/configuration/sendusing") = 2
.Item("http://schemas.microsoft.com/cdo/configuration/smtpserver") = "mail.server.com"
.Item("http://schemas.microsoft.com/cdo/configuration/smtpserverport") = 25
'*** Authentication ***'
.Item ("http://schemas.microsoft.com/cdo/configuration/smtpauthenticate") = 1
.Item ("http://schemas.microsoft.com/cdo/configuration/sendusername") = "username" '*** User ***'
.Item ("http://schemas.microsoft.com/cdo/configuration/sendpassword") = "password" '*** Password ***'
.Item ("http://schemas.microsoft.com/cdo/configuration/smtpconnectiontimeout") = 30
.Update
End With
myMail.Configuration = cdoConfig
myMail.From = "from@site.com"
myMail.To = fromAddress
myMail.Subject = "User password !"
myMail.HTMLBody = msg
myMail.Send
Set myMail = Nothing
Response.write "<font color=""brown"" >Your pasword has been sent to your Email Address.. Pls check after some time. In case any problem Please contact the administrator </font>"
end if
%>
No comments:
Post a Comment