- include_once 'conn/conn.php';
- require_once 'Zend/Mail.php'; //Call the file for sending emails
- require_once 'Zend/Mail/Transport/Smtp.php'; / /Call SMTP verification file
- $reback = '0';
- $name = $_GET['foundname'];
- $question = $_GET['question'];
- $answer = $_GET['answer'];
- $sql = "select email from tb_member where name = '".$name."' and question = '".$question."' and answer = '".$answer."'";
- $email = $conne- >getFields($sql,0);
- if($email != ''){
- $rnd = rand(1000,time());
- $sql = "update tb_member set password = '".md5($ rnd)."' where name = '".$name."' and question = '".$question."' and answer = '".$answer."'";
- $tmpnum = $conne->uidRst ($sql);
- if($tmpnum >= 1){
- //Send password email
- $subject="Password Retrieval";
- $mailbody='Password retrieval successful. The new password for your account is '.$rnd;
- $envelope["from"]="cym3100@163.com";
- //$envelope="mrsoft8888@sohu.com"; //The one used for login defined by the online version Email
-
- /* smtp beta version sending email, using smtp as the server */
- $tr = new Zend_Mail_Transport_Smtp('192.168.1.247');
-
- $mail = new Zend_Mail();
- $mail->addTo( $email,'Get the user's new password');
- $mail->setFrom('cym3100@163.com','Tomorrow Technology's typical module program test email, change the user's registration password!');
- $mail-> setSubject($subject);
- $mail->setBodyHtml($mailbody);
- //$mail->send($tr);
-
- /* Online version sending email method*/
-
- /*$config = array('auth' => 'login',
- 'username' => 'mrsoft8888',
- 'password' => 'mrsoft8888'); //Define SMTP authentication parameters
- $transport = new Zend_Mail_Transport_Smtp(' smtp.sohu.com', $config); //Instantiate the object for verification
- $mail = new Zend_Mail('GBK'); //Instantiate the object for sending mail
- $mail->setBodyHtml($mailbody); / /Send email body
- $mail->setFrom($envelope, 'Tomorrow Technology Typical Module Program Test Email, Change User Registration Password! '); //Define the email address used to send emails
- $mail->addTo($email, 'Get the user's new password'); //Define the email address used to receive emails
- $mail->setSubject($subject); / /Define email subject
- $mail->send($transport); //Perform sending operation*/
-
- /* Online version sending email method*/
- if(false ==$mail->send($tr) ){
- $reback = '-1';
- }else{
- $reback = '1';
- }
- }else{
- $reback = '2';
- }
- }else{
- $reback = $sql;
- }
- echo $reback;
- ?>
Copy code
|