Page 1 of 2 12 LastLast
Results 1 to 10 of 11
  1. #1
    Join Date
    Jul 2014
    Posts
    1
    Plugin Contributions
    0

    Default Cannot send email after upgrade

    Hi,
    I follow the Upgrade instruction "Remove Payment & Shipping Module" before upgrade from v1.5.1. After upgrade, I was trying to install the payment & shipping module. But it came to a blank screen, and I figure out from the error log that there's a PHP Fatal error:

    'PHP Fatal error: Call to undefined method PHPMailer::SetFrom() in /home/domain/public_html/includes/functions/functions_email.php on line 25'

    Sound like the error exist when trying to send email to the default Admin email when there's a change in Configuration. And I can 'Install' the modules once I turn off the email function.

    Any idea on howto fix it? Thanks!

  2. #2
    Join Date
    Jan 2004
    Posts
    66,450
    Plugin Contributions
    81

    Default Re: Cannot send email after upgrade

    I'm guessing your /includes/classes/ files and subdirectories may be outdated or didn't upload fully. There were several files added there in v1.5.3, and some of them replaced old versions by the same name. If your uploads didn't complete properly then you'll be missing important components, and thus will get errors such as you mentioned.
    .

    Zen Cart - putting the dream of business ownership within reach of anyone!
    Donate to: DrByte directly or to the Zen Cart team as a whole

    Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
    Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

  3. #3
    Join Date
    Oct 2013
    Location
    Sunny Okanagan
    Posts
    1
    Plugin Contributions
    0

    bug Re: Cannot send email after upgrade

    I just downloaded the official 1.5.3 package, and I can confirm that it has SetFrom in line 254 - kills the contact Us form dead!
    ( functions_email.php in /includes/functions )
    v1.5.3-07192014 is the package I have downloaded - all else appears to be working OK (upgraded from 1.5.1)

    So I commented out that line, and added

    Code:
    	  $mail->From = $from_email_address;
    	  $mail->FromName = $from_email_name;
    this is working fine...

  4. #4
    Join Date
    Sep 2008
    Location
    Cleethorpes
    Posts
    1,229
    Plugin Contributions
    6

    Default Re: Cannot send email after upgrade

    Bizarrely I was getting a similar situation when trying to set up payment modules in the admin. When I tried to install a Payment Mod no matter which one, it kept going to a white screen and logging me out.

    Obviously the first place I looked was in the logs/ADMIN DEBUG files and I found this.

    [29-Oct-2014 19:50:54] PHP Fatal error: Call to undefined method PHPMailer::SetFrom() in /MYSERVERPATH/includes/functions/functions_email.php on line 254

    Tried uploading a copy of functions_email.php from a virgin Zen Cart 1.5.3..still no luck!

    So found this thread and made the change as suggested by rockandroller above and it resolved the issue.

    My only concern is, does it cause any security issues in the functions_email.php or any other issues in the 1.5.3 by changing $mail->SetFrom($from_email_address, $from_email_name); to

    $mail->From = $from_email_address;
    $mail->FromName = $from_email_name;

    Would be interested to hear back!
    Nick Smith - Venture Design and Print
    https://venturedesignandprint.co.uk

  5. #5
    Join Date
    Sep 2009
    Location
    Stuart, FL
    Posts
    13,970
    Plugin Contributions
    96

    Default Re: Cannot send email after upgrade

    Are you sure that you uploaded the Zen Cart v1.5.3 file /includes/classes/class.phpmailer.php? That module definitely has the SetFrom function defined.

    Additionally, check to make sure that the file /includes/auto_loaders/overrides/config.core.php doesn't exist. If it does, rename it to config.core.php~ and see if that doesn't clear the issue up.
    Last edited by lat9; 29 Oct 2014 at 10:20 PM. Reason: Another idea

  6. #6
    Join Date
    Sep 2008
    Location
    Cleethorpes
    Posts
    1,229
    Plugin Contributions
    6

    red flag Re: Cannot send email after upgrade

    Quote Originally Posted by lat9 View Post
    Are you sure that you uploaded the Zen Cart v1.5.3 file /includes/classes/class.phpmailer.php? That module definitely has the SetFrom function defined.

    Additionally, check to make sure that the file /includes/auto_loaders/overrides/config.core.php doesn't exist. If it does, rename it to config.core.php~ and see if that doesn't clear the issue up.
    No that doesn't exist and includes/classes/class.phpmailer.php is installed. This was a site developed from a clean install of Zen Cart 1.5.3

    It wasn't an upgrade.
    Nick Smith - Venture Design and Print
    https://venturedesignandprint.co.uk

  7. #7
    Join Date
    Jan 2004
    Posts
    66,450
    Plugin Contributions
    81

    Default Re: Cannot send email after upgrade

    Quote Originally Posted by Nick1973 View Post
    No that doesn't exist and includes/classes/class.phpmailer.php is installed. This was a site developed from a clean install of Zen Cart 1.5.3

    It wasn't an upgrade.
    I don't mean to be argumentative, but I think you're mistaken.

    When I download the official Zen Cart v1.5.3 release zip, I confirm that the class.phpmailer.php file does indeed contain the SetFrom function ... on line 710.
    If yours doesn't, then you've somehow replaced it with a different one, or wherever you got the Zen Cart files from is giving you something different.

    Open the file and copy the first 25 lines of that file to your clipboard, and paste them here in a reply.
    .

    Zen Cart - putting the dream of business ownership within reach of anyone!
    Donate to: DrByte directly or to the Zen Cart team as a whole

    Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
    Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

  8. #8
    Join Date
    Nov 2010
    Location
    Horsham
    Posts
    4
    Plugin Contributions
    0

    Default Re: Cannot send email after upgrade

    Quote Originally Posted by DrByte View Post
    I don't mean to be argumentative, but I think you're mistaken.

    When I download the official Zen Cart v1.5.3 release zip, I confirm that the class.phpmailer.php file does indeed contain the SetFrom function ... on line 710.
    If yours doesn't, then you've somehow replaced it with a different one, or wherever you got the Zen Cart files from is giving you something different.

    Open the file and copy the first 25 lines of that file to your clipboard, and paste them here in a reply.

    I too have the same issue...

    The SetFrom function does not exist in my copy of the file...

    Here is my first 25 lines of code from the class.phpmailer.php file:

    <?php
    ////////////////////////////////////////////////////
    // PHPMailer - PHP email class
    //
    // Class for sending email using either
    // sendmail, PHP mail(), or SMTP. Methods are
    // based upon the standard AspEmail(tm) classes.
    //
    // Copyright (C) 2001 - 2003 Brent R. Matzelle
    //
    // License: LGPL, see LICENSE
    ////////////////////////////////////////////////////

    /**
    * PHPMailer - PHP email transport class
    *
    * @package classes
    * @author Brent R. Matzelle
    * @copyright 2001 - 2003 Brent R. Matzelle
    * @version (within Zen Cart) $Id: class.phpmailer.php 19328 2011-08-06 22:53:47Z drbyte $
    * @version Modified for Zen Cart added protocols to enable use with Gmail 2007-09-30 Chuck Redman
    */
    /**
    * PHPMailer - PHP email transport class
    *

  9. #9
    Join Date
    Sep 2009
    Location
    Stuart, FL
    Posts
    13,970
    Plugin Contributions
    96

    Default Re: Cannot send email after upgrade

    Here are the first 25 lines from /includes/classes/class.phpmailer.php from the Zen Cart v1.5.3 codebase:
    Code:
    <?php
    /*~ class.phpmailer.php
    .---------------------------------------------------------------------------.
    |  Software: PHPMailer - PHP email class                                    |
    |   Version: 5.2.6                                                          |
    |      Site: https://github.com/PHPMailer/PHPMailer/                        |
    | ------------------------------------------------------------------------- |
    |    Admins: Marcus Bointon                                                 |
    |    Admins: Jim Jagielski                                                  |
    |   Authors: Andy Prevost (codeworxtech) [email protected] |
    |          : Marcus Bointon (coolbru) [email protected]          |
    |          : Jim Jagielski (jimjag) jimjag######################                        |
    |   Founder: Brent R. Matzelle (original founder)                           |
    | Copyright (c) 2010-2012, Jim Jagielski. All Rights Reserved.              |
    | Copyright (c) 2004-2009, Andy Prevost. All Rights Reserved.               |
    | Copyright (c) 2001-2003, Brent R. Matzelle                                |
    | ------------------------------------------------------------------------- |
    |   License: Distributed under the Lesser General Public License (LGPL)     |
    |            http://www.gnu.org/copyleft/lesser.html                        |
    | This program is distributed in the hope that it will be useful - WITHOUT  |
    | ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or     |
    | FITNESS FOR A PARTICULAR PURPOSE.                                         |
    '---------------------------------------------------------------------------'
    */
    Obviously, the code that you have for that class file isn't the version supplied with Zen Cart v1.5.3.

  10. #10
    Join Date
    Nov 2010
    Location
    Horsham
    Posts
    4
    Plugin Contributions
    0

    Default Re: Cannot send email after upgrade

    Quote Originally Posted by lat9 View Post
    Here are the first 25 lines from /includes/classes/class.phpmailer.php from the Zen Cart v1.5.3 codebase:
    Code:
    <?php
    /*~ class.phpmailer.php
    .---------------------------------------------------------------------------.
    |  Software: PHPMailer - PHP email class                                    |
    |   Version: 5.2.6                                                          |
    |      Site: https://github.com/PHPMailer/PHPMailer/                        |
    | ------------------------------------------------------------------------- |
    |    Admins: Marcus Bointon                                                 |
    |    Admins: Jim Jagielski                                                  |
    |   Authors: Andy Prevost (codeworxtech) [email protected] |
    |          : Marcus Bointon (coolbru) [email protected]          |
    |          : Jim Jagielski (jimjag) jimjag######################                        |
    |   Founder: Brent R. Matzelle (original founder)                           |
    | Copyright (c) 2010-2012, Jim Jagielski. All Rights Reserved.              |
    | Copyright (c) 2004-2009, Andy Prevost. All Rights Reserved.               |
    | Copyright (c) 2001-2003, Brent R. Matzelle                                |
    | ------------------------------------------------------------------------- |
    |   License: Distributed under the Lesser General Public License (LGPL)     |
    |            http://www.gnu.org/copyleft/lesser.html                        |
    | This program is distributed in the hope that it will be useful - WITHOUT  |
    | ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or     |
    | FITNESS FOR A PARTICULAR PURPOSE.                                         |
    '---------------------------------------------------------------------------'
    */
    Obviously, the code that you have for that class file isn't the version supplied with Zen Cart v1.5.3.
    Thank you!

    I have just re-downloaded the files and everything is all present and correct :-)

 

 
Page 1 of 2 12 LastLast

Similar Threads

  1. Cannot Send Email with IIS 7
    By kcchan in forum General Questions
    Replies: 3
    Last Post: 13 Jun 2009, 03:59 PM
  2. Cannot send email to SOME addresses
    By Rasyr in forum General Questions
    Replies: 2
    Last Post: 12 Dec 2007, 05:05 AM
  3. cannot send email.
    By mundi in forum General Questions
    Replies: 1
    Last Post: 26 Nov 2007, 06:59 PM
  4. Cannot send customers email
    By bhfruitcakeco in forum General Questions
    Replies: 2
    Last Post: 21 Dec 2006, 09:15 PM
  5. Cannot send email after upgrade using local Windows server
    By AcurA in forum Upgrading from 1.3.x to 1.3.9
    Replies: 6
    Last Post: 8 Sep 2006, 09:18 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
disjunctive-egg