Results 1 to 3 of 3
  1. #1
    Join Date
    Sep 2009
    Location
    Stuart, FL
    Posts
    13,873
    Plugin Contributions
    96

    Default Started receiving "Could not instantiate mail function" ...

    ... on a Zen Cart 1.5.1 site that I've done some programming for. They're hosted on bluehost (are they really "compatible" hosts?) and over the past couple of days, the office staff noticed that they're not receiving order-confirmation emails (although the orders are recorded in the database).

    I added a bit of debug code and found that the subject message (Could not instantiate mail function) is being returned by the phpMailer->Send function (the site's using the PHP email method with all default settings).

    The sweet-young-thing that I spoke to on the phone ran a "test" using the PHP built-in mail function (which did sent that email) and then said that (essentially) BlueHost isn't in the business of debugging custom programming when I pointed out that its the phpMailer processing (which worked on Tuesday) that's failing.

    Other than changing the mail-transport method to SMTP, anybody got any clues as to what bluehost has changed to cause these (silent) email failures?

  2. #2
    Join Date
    Jan 2004
    Posts
    66,443
    Plugin Contributions
    279

    Default Re: Started receiving "Could not instantiate mail function" ...

    I've observed that bluehost is definitely less compliant with usual standards than they were in the past.

    Quote Originally Posted by lat9 View Post
    anybody got any clues as to what bluehost has changed to cause these (silent) email failures?
    The list of possibilities is long.

    I suspect they've changed the PHP version and the php.ini defaults (for email/smtp) are different than what they were before.

    I'd start with this, to do more regular logging of failures: https://github.com/zencart/zencart/pull/801/files
    (but that might have other dependencies from newer ZC versions, particularly the enable_error_logging.php file updates, with which lat9 I know you're already familiar)

    If you can consistently trigger the problem, then turn on the email debugging, using the constant at the top of functions_email.php. Setting it to something higher than 0 will cause detailed output (TO THE SCREEN!) which you can use to understand the specifics better. But, make sure it's only temporary due to the info that'll be shown to whoever's triggering emails to be sent.

    But, as you suggested, switching to SMTP (actually SMTPAUTH is even better IMO) can probably bypass the issue.



    AND an update to the latest ZC version will help since it also includes a more modern version of PHPMailer, which is more compatible with modern server configurations than when v151 was released several years ago.
    .

    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
    Sep 2009
    Location
    Stuart, FL
    Posts
    13,873
    Plugin Contributions
    96

    Default Re: Started receiving "Could not instantiate mail function" ...

    Thanks (as always), DrByte. It was, essentially, that change that you posted that led me to the (otherwise silently-failing) email issue!

    I'll play with the email-debug levels, too, to try to get a handle on the error -- but this is one of those issues where I'll be happy to simply find a work-around (like just changing to SMTPAUTH).

    To your final comment, you're preaching to the choir (but it's the shop's busy season) and we're already considering that upgrade sometime in the fall.

 

 

Similar Threads

  1. Replies: 6
    Last Post: 28 May 2015, 05:04 PM
  2. Replies: 5
    Last Post: 22 May 2015, 06:09 PM
  3. Could not instantiate mail function
    By veronicathecow in forum Discounts/Coupons, Gift Certificates, Newsletters, Ads
    Replies: 6
    Last Post: 16 Nov 2011, 06:52 PM
  4. Replies: 4
    Last Post: 8 Sep 2008, 03:22 AM
  5. Could not instantiate mail function
    By stage in forum General Questions
    Replies: 1
    Last Post: 10 Aug 2007, 04:50 AM

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