Print Page | Close Window

From CDONTS To JMAIL

Printed From: Web Wiz Forums
Category: General Discussion
Forum Name: Classic ASP Discussion
Forum Description: Discussion on Active Server Pages (Classic ASP).
URL: https://forums.webwiz.net/forum_posts.asp?TID=2226
Printed Date: 29 March 2026 at 8:42am
Software Version: Web Wiz Forums 12.08 - https://www.webwizforums.com


Topic: From CDONTS To JMAIL
Posted By: lana
Subject: From CDONTS To JMAIL
Date Posted: 28 April 2003 at 12:38am

Hi
Can some one help me please , i want to change this getpassword.asp page code, need Jmail instead of CDONTS (case server support ).
the page can send an email with password after the member insert his email .

Thanks a lot
-------------------------------------------------------

getpassword.asp

<!--#include file="conn.asp"-->
<%
mailerror = false
If Request.Form("password") <> "" Then

 txtemail = Request.Form("Email")
 
 set rs = server.createobject("adodb.recordset")
 
 sql = "Select * From Users Where Email='" & txtEmail & "';"
 
 rs.open sql, conn, 3, 3
 
 If not rs.eof then
  Dim myMail, myBody
 
  Set myMail = CreateObject("CDONTS.NewMail")
 
  myBody= "Your username is " & rs("Username") & vbCRLF & "Your password is " & rs("Password") & vbCRLF & "Your are receiving this email from a request at YOUR WEB." & vbCRLF & _
  "If you received this email in error, please contact us"
 
  myMail.From="YOUR MAIL ADDRESS"
  myMail.To= txtemail
  myMail.Subject="Requested Username/Password"
  myMail.Body=myBody
  myMail.Send
  
  set mymail=nothing
  rs.close
  set rs = nothing
  conn.close
  set conn = nothing
  
  Response.redirect("success.asp")
 else
  mailerror = true
 end if
end if
%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">

<HTML><HEAD><TITLE>Get password</TITLE>
<META http-equiv=Content-Type content="text/html; charset=windows-1252">
<META content=, name=Keywords>
<META content=, name=description>
<link href="style.css" rel="stylesheet" type="text/css">
<META content="MSHTML 5.50.4134.100" name=GENERATOR>
</HEAD>

<BODY>
      <span class="dochead">Forgot password ?</span><br>
    If you have forgot your password, just fill in the e-mail you used when you registered.<br> Your username and password will be mailed to this address.
    
    <%if mailerror = true then %><b><span class="required"><p>Invalid email address. Please try again</p></span></b><%end if%><form action="getpassword.asp" method="post">
<INPUT TYPE="HIDDEN" NAME="password" VALUE="yes">


  Email:
  <input onmouseover=this.focus() class="niceinput" name="Email" type="text" size="20">

          <input class="niceinput" name="Submit" type="submit" value="Submit">
    <br><a href="default.asp">Home</a>
    

 </BODY></HTML>




Replies:
Posted By: Mart
Date Posted: 29 April 2003 at 9:56am
http://www.dimac.net/ - http://www.dimac.net/  you will find lots of JMAIL examples on there.



Print Page | Close Window

Forum Software by Web Wiz Forums® version 12.08 - https://www.webwizforums.com
Copyright ©2001-2026 Web Wiz Ltd. - https://www.webwiz.net