Zen Cart Logo
Forums / General Questions / How do I use the zen_mail function with additional CC: (carbon copied) email address

How do I use the zen_mail function with additional CC: (carbon copied) email address

Views: 4,509

Results 1 to 7 of 7
24 Oct 2013, 11:19 PM
#1
donn avatar

donn

Zen Follower

Join Date:
Oct 2007
Posts:
241
Plugin Contributions:
0

How do I use the zen_mail function with additional CC: (carbon copied) email address

I am interested in having the zen_mail function also send an e-mail to a CC:'d address. The solution I'm looking for must be specifically using the CC function of the mailer, not an array of consecutive emails sent out one after the other, nor as a BCC e-mail!

Outside of Zen Cart, I know this works:

$headers .= 'Cc: [email protected]' . "\r\n";

24 Oct 2013, 11:35 PM
#2
donn avatar

donn

Zen Follower

Join Date:
Oct 2007
Posts:
241
Plugin Contributions:
0

Re: How do I use the zen_mail function with additional CC: (carbon copied) email address

Using something like

...

zen_mail ($send_to_name, $send_to_email

...

Setting $send_to_email to "email1(at)aol(dot)com, email2(at)aol(dot)com" seems to send out the email to both addresses, but not with CC! :huh:

25 Oct 2013, 1:42 PM
#3
afo avatar

afo

Totally Zenned

Join Date:
Aug 2004
Location:
New York City
Posts:
6,800
Plugin Contributions:
0

Re: How do I use the zen_mail function with additional CC: (carbon copied) email address

There's a setting for this in the admin, but I don't think it does an actual CC.

25 Oct 2013, 2:33 PM
#4
donn avatar

donn

Zen Follower

Join Date:
Oct 2007
Posts:
241
Plugin Contributions:
0

Re: How do I use the zen_mail function with additional CC: (carbon copied) email address

afo:

There's a setting for this in the admin, but I don't think it does an actual CC.

Really? I've never stumbled upon it yet. Even if it's not precisely what I need for this, later it may be useful knowing where that is. Please let me know!

I found the file that does the email functions called functions_email.php.

At line 224: $mail->Subject = $email_subject;
225:$mail->From = $from_email_address;
226: $mail->FromName = $from_email_name;
227: $mail->AddAddress($to_email_address, $to_name);
228: //$mail->AddAddress($to_email_address); // (alternate format if no name, since name is optional)
229: //$mail->AddBCC(STORE_OWNER_EMAIL_ADDRESS, STORE_NAME);

What about uncommenting line 229?

Or could I just change it to:
$mail->AddCC(STORE_OWNER_EMAIL_ADDRESS, STORE_NAME);

??

25 Oct 2013, 3:27 PM
#5
donn avatar

donn

Zen Follower

Join Date:
Oct 2007
Posts:
241
Plugin Contributions:
0

Re: How do I use the zen_mail function with additional CC: (carbon copied) email address

Uncommenting line 229 above seems to send a copy to the store's email address.

When I changed it to :$mail->AddCC(STORE_OWNER_EMAIL_ADDRESS, STORE_NAME);

I do not think it works.

25 Oct 2013, 5:33 PM
#6
stevesh avatar

stevesh

Black Belt

Join Date:
Feb 2005
Location:
Lansing, Michigan USA
Posts:
19,793
Plugin Contributions:
2

Re: How do I use the zen_mail function with additional CC: (carbon copied) email address

You don't say what emails you want to CC, but in Admin - Configuration - Email Settings you can add more recipients to most of the standard Zencart emails. As afo said, I don't know if it'll show up as a CC.

25 Oct 2013, 9:43 PM
#7
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,513
Plugin Contributions:
177

Re: How do I use the zen_mail function with additional CC: (carbon copied) email address

Adding $mail->AddCC() will add specific headers to cc specific recipients.
This requires manual coding on a case-by-case basis.
You probably don't want all your customers seeing cc's to all kinds of other people on the emails sent to them about their personal private purchases!