Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Unable to send email

Status
Not open for further replies.

Goog

MIS
Mar 12, 2002
6
US
Hello, i am still unable to send mail so may i know what is wrong with the following code?


<%

if (Request.Form (&quot;text1&quot;) <> &quot;&quot; ) then

Dim DataConn, oRs
Dim SQL, myEmail,Email2
Dim password2
Dim objMail
Dim strMessage

myEmail=Request.Form (&quot;text1&quot;)

Set DataConn = Server.CreateObject(&quot;ADODB.Connection&quot;)

DataConn.ConnectionString =&quot;driver={sql server};server=CON7;database=user;DSN=localserver;PWD=sa;UID=sa;&quot;

DataConn.Open

SQL=&quot;select password, email from info where email='&quot; & myEmail & &quot;'&quot;

Set oRs= Server.CreateObject (&quot;ADODB.recordset&quot;)

oRs.Open SQL, DataConn, 3

If oRs.EOF Then
Response.Write &quot;<html><head><body bgcolor='#000000' text='#ffff00'><center>&quot;
Response.Write &quot;<font face='verdana' size='+2'><p>&quot;
Response.Write &quot;No records found:<p> Use the browser's back button to go back and try again&quot;
Response.Write &quot;</font></body></html>&quot;
Response.End
end if

Email2=oRs(&quot;email&quot;)
password2=oRs(&quot;password&quot;)

oRs.Close
Set oRs=nothing


Set objMail = Server.CreateObject(&quot;CDONTS.NewMail&quot;)

objMail.From=&quot;yoursystem@sys.com&quot;
objMail.To = Email2
objMail.Subject =&quot;Your Password&quot;
objMail.Body= password2

objMail.Send
Set objMail= nothing


Response.Redirect (&quot;else%>
<script>
window.alert (&quot;Unsuccessful&quot;)
</script>
<%End if
%>
Thank You! X-)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top