123456789101112131415161718192021222324252627282930313233343536 |
- <?php
- require 'phpmailer/PHPMailerAutoload.php';
- include_once ('tools/util.php');
- function send_forgotten_mail($email, $username, $link) {
- if (!isset($ini)) {
- $ini = read_config ();
- }
- $mail = new PHPMailer ();
-
- $mail->isSMTP ();
-
- $mail->Host = $ini ["mail_server"];
- $mail->SMTPAuth = true;
- $mail->Username = $ini ["mail_user"];
- $mail->Password = $ini ["mail_pwd"];
-
-
-
- $mail->From = $ini ["mail_from"];
- $mail->FromName = 'Mailer';
- $mail->addAddress ( $email );
-
- $mail->Subject = 'Reset password';
- $mail->Body = 'You can reset your password with this link: ' . $link;
-
-
- if (! $mail->send ()) {
- return false;
- } else {
- return true;
- }
- }
- ?>
|