Results 1 to 9 of 9
  1. #1
    Join Date
    Apr 2008
    Posts
    15
    Plugin Contributions
    0

    Default Admin - Tools > Send Email

    I am getting the following message when I try to send an email from the Admin area:

    Fatal error: Call to a member function on a non-object in /web/store/admin/mail.php on line 380

    I am using version 1.3.8a. Any suggestions?

  2. #2
    Join Date
    Apr 2008
    Posts
    15
    Plugin Contributions
    0

    Default Re: Admin - Tools > Send Email

    Here is the code from admin/mail.php, lines 376-385:

    <?php } // end upload dialog ?>
    <?php
    $dir = @dir(DIR_WS_ADMIN_ATTACHMENTS);
    $file_list[] = array('id' => '', 'text' => "(none)");
    while ($file = $dir->read()) {
    if (is_file(DIR_WS_ADMIN_ATTACHMENTS . $file) && strtoupper($file) != 'CVS' && $file != "." && $file != "..") {
    $file_list[] = array('id' => $file , 'text' => $file);
    }
    }
    ?>

    line 380 reads: while ($file = $dir->read()) {

  3. #3
    Join Date
    Jan 2004
    Posts
    66,373
    Blog Entries
    7
    Plugin Contributions
    274

    Default Re: Admin - Tools > Send Email

    That code starts a couple lines lower in the official 1.3.8a code.

    Nevertheless, you can fix it by changing that line from this:
    Code:
      while ($file = $dir->read()) {
    to this:
    Code:
      while (false && $file = $dir->read()) {
    ... since attachment support is not functional at this time.
    The error is a result of it attempting to read a folder where attachments might be stored, and finding the directory doesn't exist ... which suggests other issues about how you've set up your site, but that's another story.
    .

    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.

  4. #4
    Join Date
    Apr 2008
    Posts
    15
    Plugin Contributions
    0

    Default Re: Admin - Tools > Send Email

    Thanks for the fix. Not sure what you mean about the store not set up properly. We actually had a company move our site and update it at the same time. A little disconcerting. Anyway, I sent an email to our newsletter subscribers and got this:

    500 Server Error

    The server encountered an internal error or misconfiguration and was unable to complete your request.
    Please contact the server administrator, [email protected] and inform them of the time the error occurred , and anything you might have done that may have caused the error. [thunderer/18631]

    Error: HTTPd: malformed header from script /store/admin/mail.php

    I received the email, but I am not sure who else did. This may be what you aluded to earlier about the site not being set up right?

    Is there a place I can just download the mail.php file? Is mine corrupt. I saw a post about running some Windows program to compare files for errors, but I am on a Mac. Any ideas?

  5. #5
    Join Date
    Jan 2004
    Posts
    66,373
    Blog Entries
    7
    Plugin Contributions
    274

    Default Re: Admin - Tools > Send Email

    Quote Originally Posted by bRodg6504 View Post
    We actually had a company move our site and update it at the same time.
    It may be appropriate to be reporting these problems to them.

    Quote Originally Posted by bRodg6504 View Post
    500 Server Error

    The server encountered an internal error or misconfiguration and was unable to complete your request.
    Please contact the server administrator, [email protected] and inform them of the time the error occurred , and anything you might have done that may have caused the error. [thunderer/18631]

    Error: HTTPd: malformed header from script /store/admin/mail.php
    500 Server Error and Internal Server Error messages can be caused by a number of things.
    I suppose it's possible that the file mentioned may be damaged.
    Isn't that the one you just edited?

    Quote Originally Posted by bRodg6504 View Post
    Is there a place I can just download the mail.php file? Is mine corrupt.
    You can get teh complete Zen Cart fileset by following the various links from the Zen Cart website, either from the home page or the title bar on every page, or from the FAQs area: https://www.zen-cart.com/tutorials/i...hp?article=323

    Quote Originally Posted by bRodg6504 View Post
    I saw a post about running some Windows program to compare files for errors, but I am on a Mac. Any ideas?
    BBedit is one of a few programs available for Mac. Some are mentioned in this thread about comparison tools: http://www.zen-cart.com/forum/showthread.php?t=7330
    .

    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
    Apr 2008
    Posts
    15
    Plugin Contributions
    0

    Default Re: Admin - Tools > Send Email

    I downloaded the full fileset and replace the 'mail.php' in both the admin folder and the 'admin>includes>languages>english' folder and still get the same error. Could it be timing out?

  7. #7
    Join Date
    Apr 2008
    Posts
    15
    Plugin Contributions
    0

    Default Re: Admin - Tools > Send Email

    Okay, weird thing. When I replaced the 'mail.php' files, I didn't make the earlier change and the email page worked fine, except for the 500 error. I didn't get the problem I had earlier about not being able to even send an email. And now when I look at my newsletter section, it says it sent the last one, but we didn't get any bounced emails like we normally do. Weird.

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

    Default Re: Admin - Tools > Send Email

    Quote Originally Posted by DrByte View Post
    The error is a result of it attempting to read a folder where attachments might be stored, and finding the directory doesn't exist ... which suggests other issues about how you've set up your site, but that's another story.
    I have updated a zen-install that was horribly out of date to the 1.38a code base and also ran into the read() mail error. Your supplied band-aid worked but what folder must be missing that generates the error? I compared the default install against the store I am managing and the folder structure appears the same except for additional modules.

    Thank you

  9. #9
    Join Date
    Jan 2004
    Posts
    66,373
    Blog Entries
    7
    Plugin Contributions
    274

    Default Re: Admin - Tools > Send Email

    If the bandage fixed it, don't worry about folders. The attachment feature isn't functional in v1.3.x anyway, so it's really a non-issue.
    .

    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.

 

 

Similar Threads

  1. v139h Admin/Tools/Send Email sends 4 copies to customers
    By KiaV in forum General Questions
    Replies: 5
    Last Post: 5 Jun 2012, 12:35 PM
  2. Replies: 3
    Last Post: 29 Sep 2011, 04:56 PM
  3. Sending E-Mail works except from admin/tools/send email
    By Ron Haltermon in forum General Questions
    Replies: 0
    Last Post: 11 Sep 2010, 02:27 PM
  4. trying to send email using tools > send email - get error
    By keylesslocks in forum General Questions
    Replies: 4
    Last Post: 24 Jan 2010, 05:05 PM
  5. Admin/Tools/Send Email sends 2 copies
    By Stuff4Toys in forum General Questions
    Replies: 1
    Last Post: 7 Jan 2008, 11:44 PM

Bookmarks

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
Zen-Cart, Internet Selling Services, Klamath Falls, OR