J
Jerry
hi, i seem to be having problems with this code. The code stops on the Set
NewMailObj = CreateObject("CDONTS.Newmail") Your help would be greatly
appreciated.
<%@ Language=VBScript %>
<!--#include file="ADOvbs.inc"-->
<!--#include file="cdonts.inc"-->
<%Username = Cstr(Trim(Request.form("UserName")))%>
<%email = Cstr(Trim(request.form("Email")))%>
<%
Set Conn = Server.CreateObject( "ADODB.Connection" )
set oRs=Server.CreateObject("ADODB.recordset")
conn.Open "DSN=falco; uid=sa; pwd=6stang7"
strSql = "SELECT * FROM Tenant " &_
"WHERE Customerid = '" & Cstr(Request.form("UserName")) & "' " &_
"AND email = '" & Cstr(Request.form("email")) & "'"
oRS.open strSql, conn
if not ors.eof then
oRS.movefirst
do while not oRS.eof
dim NewMailObj
Set NewMailObj = CreateObject("CDONTS.Newmail")
newMailObj.From = "(e-mail address removed)"
newMailObj.To = ors("email")
newMailObj.Subject = ors("Password")
newMailObj.BodyFormat = CdoBodyFormatText
sMailBody = "Dear " & ors("Tenant") & "," & vbNewLine & vbNewLine
sMailBody = sMailBody & ors("password")
newMailObj.Body = sMailBody
newMailObj.Send
Set newMailObj = Nothing
ors.movenext
loop
end if
oRs.close
set oRS=nothing
%>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
<title>Email</title></head>
<body>
<H2>Your message has been sent!</H2>
</BODY>
</html>
NewMailObj = CreateObject("CDONTS.Newmail") Your help would be greatly
appreciated.
<%@ Language=VBScript %>
<!--#include file="ADOvbs.inc"-->
<!--#include file="cdonts.inc"-->
<%Username = Cstr(Trim(Request.form("UserName")))%>
<%email = Cstr(Trim(request.form("Email")))%>
<%
Set Conn = Server.CreateObject( "ADODB.Connection" )
set oRs=Server.CreateObject("ADODB.recordset")
conn.Open "DSN=falco; uid=sa; pwd=6stang7"
strSql = "SELECT * FROM Tenant " &_
"WHERE Customerid = '" & Cstr(Request.form("UserName")) & "' " &_
"AND email = '" & Cstr(Request.form("email")) & "'"
oRS.open strSql, conn
if not ors.eof then
oRS.movefirst
do while not oRS.eof
dim NewMailObj
Set NewMailObj = CreateObject("CDONTS.Newmail")
newMailObj.From = "(e-mail address removed)"
newMailObj.To = ors("email")
newMailObj.Subject = ors("Password")
newMailObj.BodyFormat = CdoBodyFormatText
sMailBody = "Dear " & ors("Tenant") & "," & vbNewLine & vbNewLine
sMailBody = sMailBody & ors("password")
newMailObj.Body = sMailBody
newMailObj.Send
Set newMailObj = Nothing
ors.movenext
loop
end if
oRs.close
set oRS=nothing
%>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
<title>Email</title></head>
<body>
<H2>Your message has been sent!</H2>
</BODY>
</html>