Results 1 to 2 of 2
  1. #1
    Join Date
    Sep 2015
    Location
    Daytona Beach, FL USA
    Posts
    65
    Plugin Contributions
    0

    Default php mail not working as I want it to

    I am trying to add a new php module within the ZC admin folder but emailing not working as expected.

    I tried this which works outside of ZC
    mail($ToEmail,$subject . ' php mail',$tempTemplate,$headers) ;
    and there are no errors but nothing happens when running within ZC with the normal
    require('includes/application_top.php');
    and
    require('includes/configure.php');

    It works outside of ZC without the above requires.


    I even tried using zen_mail but does do what I need it to do.
    .
    $aaatex_html_msg['EMAIL_FROM_ADDRESS'] = $fromEmail;
    .
    zen_mail( '', $ToEmail, $subject , $tempTemplate, "AaaTeX Customer Service", "[email protected]", $aaatex_html_msg,'renewals');

    It sends the email but there are 2 issues:
    1. It doesn't use the from email above but uses the store email address which I do not want.
    2. It doesn't seem to support Bcc.

    So how can I get it to send emails with the from address and Bcc? I think that php mail would be preferable but it does nothing.

  2. #2
    Join Date
    Sep 2009
    Location
    Stuart, FL
    Posts
    12,401
    Plugin Contributions
    87

    Default Re: php mail not working within ZenCart 1.5.0

    The zen_mail function's standard processing (except for contact_us and order-confirmation emails) has the reply-to field set to the store's email address. You can override that behavior in the zen_mail call, though:
    Code:
    zen_mail ( '', $ToEmail, $subject , $tempTemplate, STORE_NAME, EMAIL_FROM, $aaatex_html_msg,'renewals', '', "AaaTeX Customer Service", "[email protected]");
    While Zen Cart doesn't support bcc: mails out-of-the-box, you could write an observer-class script to receive notifications on NOTIFY_EMAIL_READY_TO_SEND (as its name implies, the email's just ready to send). You receive a copy of the phpMailer object ($mail) as the second notification parameter, allowing you to add the BCC addresses via the phpMailer's AddBCC function.

 

 

Similar Threads

  1. Replies: 0
    Last Post: 6 Aug 2011, 08:12 PM
  2. My E-mail is not working
    By KADesign in forum General Questions
    Replies: 2
    Last Post: 20 May 2010, 06:10 PM
  3. mail() function in php is not working (apparently on homegrown server)
    By aeisjean in forum Installing on a Windows Server
    Replies: 10
    Last Post: 16 Jan 2010, 03:02 PM
  4. Mail not working, php crash?
    By dupfies01 in forum General Questions
    Replies: 3
    Last Post: 23 Oct 2008, 05:57 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