Forums / Basic Configuration / PHP5.4, Email Stopped Sending

PHP5.4, Email Stopped Sending

Views: 2,782

Results 1 to 10 of 10
16 Jul 2015, 12:43 AM
#1
haostaff avatar

haostaff

Zen Follower

Join Date:
Oct 2007
Location:
Hong Kong
Posts:
112
Plugin Contributions:
0

PHP5.4, Email Stopped Sending

Not sure whether this is a bug, or a problem on my setup or the server.

But I have spent 3 days searching for solutions, testing, troubleshooting with my host support which was very helpful. But problem persists.

I upgraded (from 1.3.7 to 1.5.4) about a month ago, and the email was working perfectly on SMTPAuth after some struggle (see the thread that got me there: https://www.zen-cart.com/showthread.php?217550-ZC137-to-ZC154-Emails-copying-to-store-owner-but-not-sending-to-customer&p=1285030#post1285030).

However, about a week ago, I suddenly started to see orders in the Admin CP that I did not receive copy of the email confirmations. I did testing, and found that now I am not receiving any email - account creation, order confirmation, contact us form email. I tested as a fake customer, and am not receiving any email as well.

I have tried different SMTP Auth setup, used different email accounts as the "send from" and the "SMTP Email Account Mailbox" with respective mail server login info. None worked. Invariably I get a green notice saying "email sent", and a red notice on top saying "Called Mail() without being connected".

I have been checking with the hosting server's support. They see nothing unusual on my account.

When I switch to PHP Email Transport method, I get same green "email sent", and then red error "Could not instantiate mail function.". In this case, the server support report the following PHP error: PHP Warning: Illegal string offset 'EMAIL_FROM_ADDRESS' in MYSTORE/includes/functions/functions_email.php on line 103, and the line's content in my file:

if (!isset($block['EMAIL_FROM_ADDRESS']) || $block['EMAIL_FROM_ADDRESS'] == '') $block['EMAIL_FROM_ADDRESS'] = $from_email_address;

The server PHP version is 5.4 and has not changed recently.

That's all info I can come up with. I need to fix this problem. Thanks a lot in advance for your attention.

Jeff

17 Jul 2015, 5:40 AM
#2
haostaff avatar

haostaff

Zen Follower

Join Date:
Oct 2007
Location:
Hong Kong
Posts:
112
Plugin Contributions:
0

Re: PHP5.4, Email Stopped Sending

I did a fresh install of a test store ZC154, and the email was not sending, too. Guess this rules out problem on Zencart and points right back at the host server side. While I installed the test store, at the server check step, I got some server issues flagged (these issues were not present when I installed my live store a month ago). See screen captures below. If anyone can pinpoint which of these issues are causing me the grieves (so that it makes it easier to communicate with my host support), it would be much appreciated.

Attachment #15432
Attachment #15433

17 Jul 2015, 10:20 AM
#3
kobra avatar

kobra

Black Belt

Join Date:
Aug 2005
Location:
Arizona
Posts:
31,500
Plugin Contributions:
4

Re: PHP5.4, Email Stopped Sending

You can/should enable email archiving in your admin
If ZenCart is creating the emails then this is where it's responsibility ends and your mail server responsibility begins

Called Mail() without being connected
You should check with your host about what smtp port they recommend as I suppose you have been using port 25

Zen-Venom Get Bitten

17 Jul 2015, 12:34 PM
#4
haostaff avatar

haostaff

Zen Follower

Join Date:
Oct 2007
Location:
Hong Kong
Posts:
112
Plugin Contributions:
0

Re: PHP5.4, Email Stopped Sending

Thank you Kobra. I enabled email archiving, and see all emails in the database, as well as the Email Archive Manager plugin in Admin CP.

For email server port, I used to use 25 when it worked and stopped. I tried 587 later (recommended by host support), but no luck.

18 Jul 2015, 7:05 AM
#5
kobra avatar

kobra

Black Belt

Join Date:
Aug 2005
Location:
Arizona
Posts:
31,500
Plugin Contributions:
4

Re: PHP5.4, Email Stopped Sending

see all emails in the database
Unfortunately, if ZenCart is creating them and passing them off to your host's MTA (mail transport agent) then this is not directly a ZenCart issue - take it up with your host

Zen-Venom Get Bitten

19 Jul 2015, 10:32 AM
#6
drbyte avatar

drbyte

Sensei

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

Re: PHP5.4, Email Stopped Sending

If it helps in debugging, you can make a temporary change in the top section of the functions_email.php file:

/**
 * Set email system debugging off or on
 * 0=off
 * 1=show SMTP status errors
 * 2=show SMTP server responses
 * 4=show SMTP readlines if applicable
 * 5=maximum information, and output it to error_log
 * 'preview' to show HTML-emails on-screen while sending
 */
  if (!defined('EMAIL_SYSTEM_DEBUG')) define('EMAIL_SYSTEM_DEBUG', [B]0[/B]);

Change the defined value from 0 to something higher like 1 or 2.
This will cause a bunch of text to be output to reveal more of what's happening in the background.

Be sure to put it back to 0 quickly, as this information could be dangerous if left visible to customers.

Then give the error message information to your hosting company so they can use it to help sort out their problem.

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

11 Mar 2016, 6:08 PM
#7
spawnie69 avatar

spawnie69

Totally Zenned

Join Date:
Sep 2005
Location:
Ocala, FL
Posts:
527
Plugin Contributions:
0

Re: PHP5.4, Email Stopped Sending

DrByte:

If it helps in debugging, you can make a temporary change in the top section of the functions_email.php file:

/**

  • Set email system debugging off or on
  • 0=off
  • 1=show SMTP status errors
  • 2=show SMTP server responses
  • 4=show SMTP readlines if applicable
  • 5=maximum information, and output it to error_log
  • 'preview' to show HTML-emails on-screen while sending
    */
    if (!defined('EMAIL_SYSTEM_DEBUG')) define('EMAIL_SYSTEM_DEBUG', [B]0[/B]);
> Change the defined value from 0 to something higher like 1 or 2.
> This will cause a bunch of text to be output to reveal more of what's happening in the background.
> 
> Be sure to put it back to 0 quickly, as this information could be dangerous if left visible to customers.
> 
> Then give the error message information to your hosting company so they can use it to help sort out their problem.

Hi Doc


I too discovered my emails not being sent today.  After I sent an email I get 'The following From address failed: [email protected] : Called Mail() without being connected'

I did what you suggested and got a server error so I had to switch back.  

I did not change files in a week so I am confused.  PHP 5.4 (Single php.ini) and zc 1.54


I do have another zc 1.54 site successfully sending emails.
So can this mean I may have screwed my files?

thanks
12 Mar 2016, 5:36 AM
#8
drbyte avatar

drbyte

Sensei

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

Re: PHP5.4, Email Stopped Sending

spawnie69:

I did what you suggested and got a server error so I had to switch back.
What error exactly?

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

12 Mar 2016, 11:46 AM
#9
spawnie69 avatar

spawnie69

Totally Zenned

Join Date:
Sep 2005
Location:
Ocala, FL
Posts:
527
Plugin Contributions:
0

Re: PHP5.4, Email Stopped Sending

I changed the 0 to 1 and it gave server error. Since then i restored my files now I'm battling the white screen problem.

12 Mar 2016, 2:49 PM
#10
drbyte avatar

drbyte

Sensei

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

Re: PHP5.4, Email Stopped Sending

spawnie69:

I changed the 0 to 1 and it gave server error.
But, that's the whole point. Changing it to 1 is supposed to expose server errors. And then you use that error message to understand more specifically how to fix the problem.
But, you didn't tell us what the error message was, so we can't help you.

Your new issue of blank pages is unrelated, and should be discussed in the other thread you've started about that.

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