Zen Cart Logo
Forums / Upgrading to 1.5.x / Cannot send email after upgrade

Cannot send email after upgrade

Views: 2,218

Results 1 to 11 of 11
26 Jul 2014, 1:59 PM
#1
kidult avatar

kidult

New Zenner

Join Date:
Jul 2014
Posts:
1
Plugin Contributions:
0

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!

29 Jul 2014, 5:11 AM
#2
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,513
Plugin Contributions:
177

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.

27 Sep 2014, 12:05 AM
#3
rockandroller avatar

rockandroller

New Zenner

Join Date:
Oct 2013
Location:
Sunny Okanagan
Posts:
1
Plugin Contributions:
0

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

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

this is working fine...

29 Oct 2014, 8:03 PM
#4
nick1973 avatar

nick1973

Totally Zenned

Join Date:
Sep 2008
Location:
Cleethorpes
Posts:
1,230
Plugin Contributions:
3

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!

29 Oct 2014, 9:16 PM
#5
lat9 avatar

lat9

Administrator

Join Date:
Sep 2009
Location:
Stuart, FL
Posts:
14,066
Plugin Contributions:
56

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.

29 Oct 2014, 9:37 PM
#6
nick1973 avatar

nick1973

Totally Zenned

Join Date:
Sep 2008
Location:
Cleethorpes
Posts:
1,230
Plugin Contributions:
3

Re: Cannot send email after upgrade

lat9:

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.

30 Oct 2014, 2:57 PM
#7
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,513
Plugin Contributions:
177

Re: Cannot send email after upgrade

Nick1973:

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.

12 Nov 2014, 8:39 PM
#8
soundcatcher avatar

soundcatcher

New Zenner

Join Date:
Nov 2010
Location:
Horsham
Posts:
4
Plugin Contributions:
0

Re: Cannot send email after upgrade

DrByte:

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 *
12 Nov 2014, 8:49 PM
#9
lat9 avatar

lat9

Administrator

Join Date:
Sep 2009
Location:
Stuart, FL
Posts:
14,066
Plugin Contributions:
56

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:

<?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.

13 Nov 2014, 4:05 PM
#10
soundcatcher avatar

soundcatcher

New Zenner

Join Date:
Nov 2010
Location:
Horsham
Posts:
4
Plugin Contributions:
0

Re: Cannot send email after upgrade

lat9:

Here are the first 25 lines from /includes/classes/class.phpmailer.php from the Zen Cart v1.5.3 codebase:

<?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 :-)
13 Nov 2014, 6:42 PM
#11
lat9 avatar

lat9

Administrator

Join Date:
Sep 2009
Location:
Stuart, FL
Posts:
14,066
Plugin Contributions:
56

Re: Cannot send email after upgrade

Yea! Glad you got it sorted out.