Results 1 to 10 of 10
  1. #1
    Join Date
    Jun 2007
    Posts
    64
    Plugin Contributions
    0

    red flag Email Error: Could not instantiate mail function

    Hello,

    IIS 6
    PHP 5.2.1
    ZenCart 1.3.7

    When a new customer signs up or someone uses the Contact Us form this error is thrown.

    Code:
    Email Error: Could not instantiate mail function
    This just started occurring and I have not made any changes to the store or the server. My SMTP is running, messages are going through, and the PHP function works just fine when used outside of ZenCart.

    What exactly triggers this flag?

    Thank you,

    TheMusician

  2. #2
    Join Date
    Nov 2006
    Location
    Papworth, Cambridgeshire, UK
    Posts
    731
    Plugin Contributions
    3

    Default Re: Email Error: Could not instantiate mail function

    It's the all singing and dancing world record informative error message isn't it?

    It's a phpMailer error - class.phpmailer.php. Rough translation, I tried to use the php mail() function, and it returned an error.

    Fraid I've never used PHP mail() on IIS, is it relaying to an external SMTP server? If so, is it possible to switch to the SMTP transport and send directly? Possibilities are a blocked port 25 or external mail server problems.

    Rgds,

    Chuck

  3. #3
    Join Date
    Jun 2007
    Posts
    64
    Plugin Contributions
    0

    Default Re: Email Error: Could not instantiate mail function

    Thanks for the reply Chuck. IIS has a built in SMTP server for outgoing mail only. I have tested it on the server, it hosts other sites that use the PHP mail() function, and it passed all tests with flying colors. The port is open. I will keep digging around.

    Thank you

  4. #4
    Join Date
    Jun 2007
    Posts
    64
    Plugin Contributions
    0

    Default Re: Email Error: Could not instantiate mail function

    I looked into the class.phpmailer.php and its default SMTP port is 25, I am using a different port, it is correct in my php.ini file. Should I mess around with the class.phpmailer.php file, or do the php.ini settings override this class?

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

    Default Re: Email Error: Could not instantiate mail function

    In Admin->Configuration->Email Options, if you set your transport method to PHP, then your php.ini will drive all of it, provided its mail() settings are able to follow the php.ini instructions.

    If you instead choose the SMTPAUTH transport method and set all your SMTP settings on that same screen (lower in the list), then Zen Cart will use those settings directly, including the port number you supply.
    .

    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.

  6. #6
    Join Date
    Nov 2006
    Location
    Papworth, Cambridgeshire, UK
    Posts
    731
    Plugin Contributions
    3

    Default Re: Email Error: Could not instantiate mail function

    And in fact if the port number is set to something other than 25, the pure SMTP (no auth) transport will use that port, although the setup screen implies otherwise.

  7. #7
    Join Date
    Jun 2007
    Posts
    64
    Plugin Contributions
    0

    Default Re: Email Error: Could not instantiate mail function

    Thanks again to both of you for the quick replies. I changed it over to smtpauth and got it working. Currently it is going to the wrong e-mail address, but it does now go through without throwing an error.

    Thank you

  8. #8
    Join Date
    Jan 2008
    Posts
    18
    Plugin Contributions
    0

    Default Re: Email Error: Could not instantiate mail function

    Quote Originally Posted by DrByte View Post
    In Admin->Configuration->Email Options, if you set your transport method to PHP, then your php.ini will drive all of it, provided its mail() settings are able to follow the php.ini instructions.

    If you instead choose the SMTPAUTH transport method and set all your SMTP settings on that same screen (lower in the list), then Zen Cart will use those settings directly, including the port number you supply.
    Hi I would first like to point out that I AM BLONDE and don't really understand all this PHP stuff But I am trying to send e mails to all my subscribers (never had a problem before) and it's coming up with the same error message .

    Please help

    marion x

  9. #9
    Join Date
    Dec 2005
    Location
    Cincinnati Ohio
    Posts
    1,026
    Plugin Contributions
    13

    Default Re: Email Error: Could not instantiate mail function

    Hi I would first like to point out that I AM BLONDE and don't really understand all this PHP stuff But I am trying to send e mails to all my subscribers (never had a problem before) and it's coming up with the same error message .

    Please help

    marion x
    A version of zencart your using would be greatly helpful and also what email method is your cart using now.

    Go to tools --> Server/Version Info tells you the version
    Go to Configuration --> Email Options -> The first line tells you what function you are using.

    All this is in the admin section.
    PCI Certified Web Hosting - ControlScan, Security Metrics (Platinum Partner), McAfee, TrustKeeper
    Business Class Web Hosting - Linux and cPanel Powered

  10. #10
    Join Date
    Dec 2009
    Location
    Bath, UK
    Posts
    8
    Plugin Contributions
    0

    Default Re: Email Error: Could not instantiate mail function

    I was having this same problem with mails that used to work and now were coming up with this error message.

    The reason I was getting it I found out was that client had changed their email addresses to a domian that didn't exist(!) - there was a typo in their domain name!
    Once I had found it and changed it - it worked like a charm!

    Thought it might help someone else who comes up against this problem

 

 

Similar Threads

  1. Email Error: Could not instantiate mail function.
    By zc_fan in forum General Questions
    Replies: 8
    Last Post: 7 Dec 2010, 09:49 PM
  2. Email Error: Could not instantiate mail function
    By hmabutas in forum General Questions
    Replies: 3
    Last Post: 18 Mar 2010, 12:08 PM
  3. Email Error: Could not instantiate mail function
    By Kami123 in forum General Questions
    Replies: 2
    Last Post: 7 Oct 2009, 07:33 PM
  4. Email Error: Could not instantiate mail function
    By flashmxfreak in forum Templates, Stylesheets, Page Layout
    Replies: 2
    Last Post: 1 Jun 2009, 06:39 PM
  5. EMAIL ERROR: Could not instantiate mail function
    By beautifulminds-us in forum Managing Customers and Orders
    Replies: 4
    Last Post: 23 Jul 2007, 03:44 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