Ok, if its just the order, I did a quick googly:
http://stackoverflow.com/questions/3797239/insert-new-item-in-array-on-any-position-in-php(http://stackoverflow.com/questions/3797239/insert-new-item-in-array-on-any-position-in-php)
$headers = array (
'From' => $this->getFromAddress(),
'To' => $to,
'Subject' => $subject,
'Date'=> date('D, d M Y H O'),
'Message-ID' => $messageId,
'X-Mailer' =>'osTicket Mailer');
/********** Custom BCC *******************/
$bcc = array('sales@you.com' => 'salesBCC@you.com','support@you.com' => 'supportBCC@you.com');
if($email=$this->getEmail()){ //can't use the getFromAddress function as that is a formatted string
$f = $email->getEmail();
// See if the senders address is in our array, if so, set the corresponding BCC address.
if(isset($bcc)) array_splice( $headers, 2, 0, array('Bcc' => $bcc ); // splice in at position 2 (numbering starts at 0)
}
Or, if that doesn't work, you can simply:
$headers = array ('From' => $this->getFromAddress(),'To' => $to);
$bcc = array('sales@you.com' => 'salesBCC@you.com','support@you.com' => 'supportBCC@you.com');
if($email=$this->getEmail()){ //can't use the getFromAddress function as that is a formatted string
$f = $email->getEmail();
// See if the senders address is in our array, if so, set the corresponding BCC address.
if(isset($bcc)) $headers = $bcc );
}
// Carry on adding the other headers..
$headers = $subject;
$headers= date('D, d M Y H O');
$headers = $messageId;
$headers = 'osTicket Mailer';