Author Topic: FIX : Recover password not sending email  (Read 620 times)

Koray Birand

  • Newbie
  • *
  • Posts: 26
    • View Profile
FIX : Recover password not sending email
« on: September 11, 2016, 12:33:23 PM »
Hi Folks,

At the moment the recover password module is not sending new passwords to users.
If you check line: 137 of file class_vam_mailer.php in vam/classes/

you will see that
$mail->From = $va_name . 'VAM system';
this should not be the VA's name, instead it should be a proper email.

So either replace your mail_password_compose function with :

      function mail_password_compose($email_address , $pass)


      {


         include('db_login.php');


         $db = new mysqli($db_host , $db_username , $db_password , $db_database);


         $db->set_charset("utf8");


         if ($db->connect_errno > 0) {


            die('Unable to connect to database [' . $db->connect_error . ']');


         }


         // Send mail to the pilot


         //  Get VA email configuration


         $sql = "select * from va_parameters";


         if (!$result = $db->query($sql)) {


            die('There was an error running the query [' . $db->error . ']');


         }


         while ($row = $result->fetch_assoc()) {


            $va_name = $row["va_name"];


         }


         $sql = "select * from config_emails";


         if (!$result = $db->query($sql)) {


            die('There was an error running the query [' . $db->error . ']');


         }


         while ($row = $result->fetch_assoc()) {


            $staff_email = $row["staff_email"];


            $ceo_email = $row["ceo_email"];


            $cc_email_1 = $row["cc_email_1"];


            $register_text = $row["register_text"];


         }

         $mail = new PHPMailer;


         $mail->From = $staff_email;


         $mail->FromName = $va_name . ' VAM system';


         $mail->addAddress($email_address);               // Name is optional


         $mail->isHTML(true);                                  // Set email format to HTML


         $mail->Subject = 'Password reset ' . $va_name;


         $mail->Body = 'Dear Pilot <p> Your new password is: ' . $pass . '<p>Regards<p>Virtual Airlines Manager system';


         $mail->AltBody = 'Dear Pilot. Your new password is:';


         if (!$mail->send()) {


            echo 'Message could not be sent';


            echo 'Mailer Error: ' . $mail->ErrorInfo;


         } else {


            echo ' ';


         }


      }




-----------------------------------------------------------------------------
or download the whole class file and replace it with the attached file...

Best
Koray Birand

VAM

  • Administrator
  • Hero Member
  • *****
  • Posts: 1328
    • View Profile
    • virtual Airlines Manager
Re: FIX : Recover password not sending email
« Reply #1 on: September 13, 2016, 11:56:19 PM »
Koray, your are my hero :-) , thanks for helping me to fix issues. I do not know when I broke this funtionality in previous versions it was working fine
VAM Creator and programmer.

justme1003

  • Newbie
  • *
  • Posts: 15
    • View Profile
Re: FIX : Recover password not sending email
« Reply #2 on: February 01, 2018, 08:18:18 PM »
Where can i downloaded the corrected class_vam_mailer.php as shown in this post . I am have issues with the emailer and can not see to get it to work. I have sent several emails and msg about this but still we are not able to use the junction