Sending blind carbon copy BCC emails in OpenCart
Sending blind carbon copy (BCC) emails in OpenCart requires edits to the system mail file and as well as the file that will send the email
system/library/mail.php
1.
Find: protected $to;
Add after: protected $bcc;
2.
Find: public function setTo($to) { $this->to = $to; }
Add after: public function setBcc($bcc) { $this->bcc = $bcc; }
3.
Find: $header .= 'From: =?UTF-8?B?' . base64_encode($this->sender) . '?= <' . $this->from . '>' . PHP_EOL;
Add after: if ($this->bcc) { $header .= 'Bcc: ' . $this->bcc . '\n'; }
Done!
To send a BCC email when a voucher is ordered, make adjustments to catalog/model/checkout/order.php
Find: $mail->setTo($order_info['email']);
Add: if (isset($data['vouchers'])) { $mail->setBcc("This email address is being protected from spambots. You need JavaScript enabled to view it."); }
Solar Spark launched
Solar Spark is a solar and general electrical company working out of Papamoa in the Bay of Plenty








