Page 1 of 2 12 LastLast
Results 1 to 10 of 15
  1. #1
    Join Date
    Jul 2005
    Location
    Connecticut - USA
    Posts
    62
    Plugin Contributions
    0

    Default E-Mail Function Errors

    Hello,

    When I try to send an email from areas such as Contact Us, Tell A Friend, etc., I get the following error message:

    ERROR: The email template file for /home/myacct/public_html/email/email_template_ or cannot be found.
    Warning: Cannot modify header information - headers already sent by (output started at /home/myacct/public_html/includes/functions/functions_email.php:219) in /home/myacct/public_html/includes/functions/functions_general.php on line 53

    The emails do get sent OK and all the information in them appears correct.

    The error appears to be coming from /includes/functions/functions_email.php starting at around line 238

    Although my PHP abilities can fit in a thimble, it appears to me as if the routine either can't find the /email directory or the file it wants within that directory.

    I have double-checked all the settings in Admin as well as trying each of the 4 different methods - sendmail, sendmail -f, smtp, smtp auth (adjusting the relevent areas as needed first of course) - but no luck.

    At this point I think I'm over my head in trying to figure this out. After a couple of days of trying my best to resolve this, I guess it may be time to reach out to someone who can tell me what I'm overlooking.

    Thanks,
    --Yizit

  2. #2
    Join Date
    Mar 2004
    Posts
    16,042
    Plugin Contributions
    5

    Default Re: E-Mail Function Errors

    check for extra white space after the closing ?> in the file in question
    Zen cart PCI compliant Hosting

  3. #3
    Join Date
    Jul 2005
    Location
    Connecticut - USA
    Posts
    62
    Plugin Contributions
    0

    Default Re: E-Mail Function Errors

    Hello,

    Thanks for the response.

    I suspect you are referring to the file /includes/functions/functions_email.php and, if so, there is no extra white space after the closing ?>

    That file was never modified but, just to be sure, I re-uploaded the file. Same error.

    Any other thoughts?

  4. #4
    Join Date
    Jul 2005
    Location
    Connecticut - USA
    Posts
    62
    Plugin Contributions
    0

    Default Re: E-Mail Function Errors

    Can someone please help with this? I'm bumping this up because I didn't want it to get buried.

    It's the first part of the error message that has me stumped -
    ERROR: The email template file for /home/myacct/public_html/email/email_template_ or cannot be found.

    Since email_template_ is not a complete filename, logic has it that something (a variable?) is not being passed to /includes/functions/functions_email.php which would complete the filename. Therefore, I can understand why the cannot be found part of the message comes up... obviously it can't find a file named email_template_.

    Since, in the /email folder, there are a number of files all beginning with email_template_ -
    email_template_checkout.html, email_template_contact_us.html, email_template_coupon.html, email_template_tell_a_friend.html, etc., it seems to me that the problem lies in whatever preceeds the call to /includes/functions/functions_email.php which is what I don't know.

    Now my rationale may be off into left field, my logic may be illogical, and/or my reasoning may be skewed but I am trying my best to resolve issues on my own. All I ask is for one of the ZC coding gurus to shed some light on the matter so I have some idea as to where to look and/or what to try next.

    I apologize for the length of this post. I'm just trying to make it as easy as I can on whomever can be of help.

    Thanks,
    --Yizit

  5. #5
    Join Date
    Jul 2005
    Location
    Connecticut - USA
    Posts
    62
    Plugin Contributions
    0

    Default Re: E-Mail Function Errors

    Is there no one that can help with this?

    I have not been idle in trying to resolve this myself, but I still haven't made any progress.

    My Hosting company did some extensive testing and they tell me all is fine on their end. I've confirmed this by running php scripts outside of ZenCart - some that I found in the Archives, some that my Hosting company provided me with - and they all worked. So, it's something in ZC and probably something I've done or neglected to do.

    All I ask is that someone PLEASE provide me with some thoughts, some ideas, or offer me some direction. I am willing to do the work - I just don't know where else to turn.

    My sincere appreciation goes out to anyone who can help.

    Thanks,
    --Yizit

  6. #6
    Join Date
    Jan 2004
    Posts
    66,446
    Plugin Contributions
    81

    Default Re: E-Mail Function Errors

    What version of Zen Cart are you using?
    .

    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.

  7. #7
    Join Date
    Jul 2005
    Location
    Connecticut - USA
    Posts
    62
    Plugin Contributions
    0

    Default Re: E-Mail Function Errors

    I'm sorry. I thought I had put that in there. It's 1.2.7

  8. #8
    Join Date
    Jan 2004
    Posts
    66,446
    Plugin Contributions
    81

    Default Re: E-Mail Function Errors

    includes/functions/functions_email.php
    line 209 starts with:
    PHP Code:
      function zen_build_html_email_from_template($module='default',$block) {

      
    // Identify and Read the template file for the type of message being sent
        
    $template_filename_base DIR_FS_EMAIL_TEMPLATES "email_template_";

        if (
    file_exists($template_filename_base str_replace(array('_extra','_admin'),'',$module) . '.html')) {
          
    $template_filename $template_filename_base str_replace(array('_extra','_admin'),'',$module) . '.html';
          } elseif (
    file_exists($template_filename_base 'default' '.html')) {
          
    $template_filename $template_filename_base 'default' '.html';
          } else {
          echo 
    'ERROR: The email template file for '.$template_filename_base.' or '.$template_filename.' cannot be found.';
          return 
    ''// couldn't find template file, so return an empty string for html message.
        

    Try replacing that with:
    PHP Code:
      function zen_build_html_email_from_template($module='default',$block) {
        global 
    $messageStack;
        
    // Identify and Read the template file for the type of message being sent
        
    $template_filename_base DIR_FS_EMAIL_TEMPLATES "email_template_";
        
    $template_filename DIR_FS_EMAIL_TEMPLATES "email_template_" $current_page_base ".html";

        if (!
    file_exists($template_filename)) {
          if (
    file_exists($template_filename_base str_replace(array('_extra','_admin'),'',$module) . '.html')) {
            
    $template_filename $template_filename_base str_replace(array('_extra','_admin'),'',$module) . '.html';
          } elseif (
    file_exists($template_filename_base 'default' '.html')) {
            
    $template_filename $template_filename_base 'default' '.html';
          } else {
            
    $messageStack->add('header','ERROR: The email template file for ('.$template_filename_base.') or ('.$template_filename.') cannot be found.','caution');
            return 
    ''// couldn't find template file, so return an empty string for html message.
          
    }
        } 
    .

    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.

  9. #9
    Join Date
    Aug 2005
    Location
    Arizona
    Posts
    27,755
    Plugin Contributions
    9

    Default Re: E-Mail Function Errors

    The following is from a fresh file set for 1.2.7

    I used the admin dev tools to find the phrase email_template_
    and it only appeared in one file listed below.

    And the what appears to be a truncated file name is in fact correct and is the same reference in other versions albeit in other line locations. As I am not a coder I only offer this to support that this is the correct call title. There is some thing else that is not being located for sure though.

    includes/functions/functions_email.php

    Line#212
    Code:
    $template_filename_base = DIR_FS_EMAIL_TEMPLATES . "email_template_";
    Aside issue: Is this a new install? Did you load it? or your Hosting Co?
    You apparently have ftp capability.

    Try reloading/reinstalling ZenCart and consider the latest version, while not the root problem as I have loaded each version numerous times with out this problem. There could be a corrupt file in your install.

    A longer method if you must find the problem would be to FTP all the ZC files to your PC, download the same version of fresh files and do a batch compare the files using something like WinMerge or another.

    As I think you have not altered much there should be little in the way of differences and a comparing editor will focus you to those that are different and you can see if they are changes that you have made or possible differences due to ???

    Hope you get it sorted out as I am sure that you will enjoy the ZenCart experience. At least after this.

  10. #10
    Join Date
    Aug 2005
    Location
    Arizona
    Posts
    27,755
    Plugin Contributions
    9

    Default Re: E-Mail Function Errors

    Scratch my post...as I see Dr. Byte has most probably come to the rescue once again!!

 

 
Page 1 of 2 12 LastLast

Similar Threads

  1. Replies: 0
    Last Post: 6 Aug 2011, 08:12 PM
  2. mail function
    By MachaNeko in forum General Questions
    Replies: 19
    Last Post: 25 Jun 2008, 07:34 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