IsSMTP(); // send using SMTP $phpmailerU->Host = "$phpmailerHost"; // SMTP server to use $phpmailerU->SMTPAuth = true; // use SMTP Auth $phpmailerU->Username = "$phpmailerUser"; // SMTP username $phpmailerU->Password = "$phpmailerPass"; // SMTP password $phpmailerU->From = "$email_from"; // sender EMail $phpmailerU->FromName = "Galatool $owner Uni $global_universe"; // sender name $phpmailerU->WordWrap = 80; // set word wrap $phpmailerU->IsHTML(false); // send as HTML } ?> <?php echo PROGRAM_NAME; ?>
 
".LOSTPW_ERROR1.""; } else { $line = mysql_fetch_object($res); if ($line->anzahl != 1) { $error_occured = true; echo "
".LOSTPW_ERROR2."
"; } else { // exactly one entry where password should be changed $res = mysql_query($query3) or die(mysql_error()); if (!$res) { $error_occured = true; echo "
".LOSTPW_ERROR1."
"; } else { $line = mysql_fetch_object($res); $email = $line->email; $loginusername = $line->username; $newpassword = substr(md5(time()),rand(0,26),6); $query2 = str_replace("?",md5($newpassword),$query2); $res = mysql_query($query2) or die(mysql_error()); if (!$res) { $error_occured = true; echo "
".LOSTPW_ERROR1."
"; } else { // Password Changed - send email $emailtext = LOSTPW_EMAIL_TEXT1.":\n\n".LOSTPW_EMAIL_TEXT2.":\n ".$loginusername."\n".LOSTPW_EMAIL_TEXT3.":\n ".$newpassword."\n"; if ($usePHPMailer) { $phpmailerU->AddAddress($email); $phpmailerU->Subject = LOSTPW_EMAIL_SUBJECT ; $phpmailerU->Body = $emailtext ; $result = ($phpmailerU->Send()); } else { $headers = "From: ".$email_from."\r\n" . 'X-Mailer: PHP/' . phpversion() . "\r\n" . "MIME-Version: 1.0\r\n" . "Content-Type: text/html; charset=utf-8\r\n" . "Content-Transfer-Encoding: 8bit\r\n"; // Send $result = mail($email, LOSTPW_EMAIL_SUBJECT, $emailtext, $headers); } if($result == true) { echo "
".LOSTPW_INFO2."
"; } else { echo "
".LOSTPW_ERROR3."
\n"; } echo '
'; } } } } } } if ((isset($error_occured) && $error_occured) || !isset($_POST['loginusername'])) { if (!isset($error_occured)) $error_occured = false; // show registration Screen echo '
'.LOSTPW_INFO1.'
 
'.REGISTER_LOGINNAME.':
'.REGISTER_EMAIL.':
 
 
'; } ?>