Zen Cart Logo
Forums / General Questions / PHP Email Not working. Can Not Reset Customer Password From Admin Add Customer page.

PHP Email Not working. Can Not Reset Customer Password From Admin Add Customer page.

Views: 3,584

Results 1 to 5 of 5
2 Apr 2014, 2:20 AM
#1
too_confused avatar

too_confused

New Zenner

Join Date:
Apr 2013
Location:
USA
Posts:
3
Plugin Contributions:
0

PHP Email Not working. Can Not Reset Customer Password From Admin Add Customer page.

I need some help badly.
A couple of days ago when trying to reset a customer password from admin add customer I started getting this error. I can not send any emails from admin as well. This has been working for almost a year until a few days ago. I am running Zen Cart 1.5.1 on a Godaddy sever. I contacted GoDaddy and they did php mailer server test and said that was ok.
Server OS: Linux 2.6.32-358.18.1.el6.nfsfixes.x86_64 Database: MySQL 5.0.96-log
Server Date: 04/01/2014 19:17:27 Database Date: 04/01/2014 19:17:27
Server Up Time: 19:17:27 up 88 days, 8:50, 0 users, load average: 5.78, 5.96, 5.85 HTTP Server: Apache
PHP Version: 5.2.17 (Zend: 2.2.0) PHP Memory Limit: 64M PHP Safe Mode: Off
PHP File Uploads: On Max Size: 32M POST Max Size: 33M
Database Data Size: 1,824 kB Database Index Size: 783 kB

[01-Apr-2014 18:53:07] PHP Fatal error: Class 'PHPMailer' not found in /home/content/05/10437005/html/MYAdmin/includes/functions/functions_email.php on line 174

Here are some of the lines of my functions_email.php

// handling admin/"extra"/copy emails:
if (ADMIN_EXTRA_EMAIL_FORMAT == 'TEXT' && substr($module,-6)=='_extra') {
$email_html=''; // just blank out the html portion if admin has selected text-only
}
//determine what format to send messages in if this is an admin email for newsletters:
if ($customers_email_format == '' && ADMIN_EXTRA_EMAIL_FORMAT == 'HTML' && in_array($module, array('newsletters', 'product_notification')) && isset($_SESSION['admin_id'])) {
$customers_email_format = 'HTML';
}

  // special handling for XML content
  if ($module == 'xml_record') {
    $email_html = '';
    $customers_email_format ='TEXT';
  }

         //notifier intercept option
        $zco_notifier->notify('NOTIFY_EMAIL_AFTER_EMAIL_FORMAT_DETERMINED');

        // now lets build the mail object with the phpmailer class
 174 $mail = new PHPMailer();
       $lang_code = strtolower(($_SESSION['languages_code'] == '' ? 'en' : $_SESSION['languages_code'] ));
       $mail->SetLanguage($lang_code, DIR_FS_CATALOG . DIR_WS_CLASSES . 'support/');
       $mail->CharSet =  (defined('CHARSET')) ? CHARSET : "iso-8859-1";
       $mail->Encoding = (defined('EMAIL_ENCODING_METHOD')) ? EMAIL_ENCODING_METHOD : "7bit";
       if ((int)EMAIL_SYSTEM_DEBUG > 0 ) $mail->SMTPDebug = (int)EMAIL_SYSTEM_DEBUG;
      $mail->WordWrap = 76;    // set word wrap to 76 characters
  // set proper line-endings based on switch ... important for windows vs linux hosts:
  $mail->LE = (EMAIL_LINEFEED == 'CRLF') ? "\r\n" : "\n";

  switch (EMAIL_TRANSPORT) {
    case 'smtp':
      $mail->IsSMTP();
      $mail->Host = trim(EMAIL_SMTPAUTH_MAIL_SERVER);
      if (EMAIL_SMTPAUTH_MAIL_SERVER_PORT != '25' && EMAIL_SMTPAUTH_MAIL_SERVER_PORT != '') $mail->Port = trim(EMAIL_SMTPAUTH_MAIL_SERVER_PORT);
      $mail->LE = "\r\n";
      break;
    case 'smtpauth':
      $mail->IsSMTP();
      $mail->SMTPAuth = true;
      $mail->Username = (zen_not_null(EMAIL_SMTPAUTH_MAILBOX)) ? trim(EMAIL_SMTPAUTH_MAILBOX) : EMAIL_FROM;
      $mail->Password = trim(EMAIL_SMTPAUTH_PASSWORD);
      $mail->Host = trim(EMAIL_SMTPAUTH_MAIL_SERVER);
      if (EMAIL_SMTPAUTH_MAIL_SERVER_PORT != '25' && EMAIL_SMTPAUTH_MAIL_SERVER_PORT != '') $mail->Port = trim(EMAIL_SMTPAUTH_MAIL_SERVER_PORT);
      $mail->LE = "\r\n";
      //set encryption protocol to allow support for Gmail or other secured email protocols
      if (EMAIL_SMTPAUTH_MAIL_SERVER_PORT == '465' || EMAIL_SMTPAUTH_MAIL_SERVER_PORT == '587' || EMAIL_SMTPAUTH_MAIL_SERVER == 'smtp.gmail.com') $mail->Protocol = 'ssl';
      if (defined('SMTPAUTH_EMAIL_PROTOCOL') && SMTPAUTH_EMAIL_PROTOCOL != 'none') {
        $mail->Protocol = SMTPAUTH_EMAIL_PROTOCOL;
        if (SMTPAUTH_EMAIL_PROTOCOL == 'starttls' && defined('SMTPAUTH_EMAIL_CERTIFICATE_CONTEXT')) {
          $mail->Starttls = true;
          $mail->Context = SMTPAUTH_EMAIL_CERTIFICATE_CONTEXT;
        }
      }

Attachment 13936

2 Apr 2014, 9:37 AM
#2
rodg avatar

rodg

Deceased

Join Date:
Jan 2007
Location:
Australia
Posts:
6,263
Plugin Contributions:
4

Re: PHP Email Not working. Can Not Reset Customer Password From Admin Add Customer page.

Does the file /includes/classes/class.phpmailer.php exist?

2 Apr 2014, 4:47 PM
#3
too_confused avatar

too_confused

New Zenner

Join Date:
Apr 2013
Location:
USA
Posts:
3
Plugin Contributions:
0

Re: PHP Email Not working. Can Not Reset Customer Password From Admin Add Customer page.

Thanks very much for your help.
It does not appear in either of the /includes/classes/ folders.
Where can I get it?
Thanks

2 Apr 2014, 5:16 PM
#4
too_confused avatar

too_confused

New Zenner

Join Date:
Apr 2013
Location:
USA
Posts:
3
Plugin Contributions:
0

Re: PHP Email Not working. Can Not Reset Customer Password From Admin Add Customer page.

Thanks man, you are a genius. That took care of the problem. I have no idea why it was missing.
I found it in one of my backups and added it, now all is well.
Thanks again and again.

3 Apr 2014, 9:42 AM
#5
rodg avatar

rodg

Deceased

Join Date:
Jan 2007
Location:
Australia
Posts:
6,263
Plugin Contributions:
4

Re: PHP Email Not working. Can Not Reset Customer Password From Admin Add Customer page.

too confused:

Thanks man, you are a genius.

I wish :)

too confused:

That took care of the problem.
I have no idea why it was missing.
I found it in one of my backups and added it, now all is well.
Thanks again and again.

I'm glad you found it. Saves me the trouble of telling you where to find it. <g>

At this stage in may be prudent to perform a file comparison with the ZenCart distribution files just in case other files are missing. You may not notice other issues yourself and you can't rely on you customers to report any problems they experience to you.

Cheers
RodG