@twisted1919, How i can switсh off this header? http://prntscr.com/g2ojp4
Which file should I change? Which line should I delete?
Yii::app()->hooks->addFilter('console_command_send_campaigns_before_send_to_subscriber', function($emailParams, $campaign, $subscriber, $customer, $server){
foreach ($emailParams['headers'] as $index => $header) {
if ($header['name'] == 'WhateverHeaderNameHere') {
unset($emailParams['headers'][$index]);
}
}
return $emailParams;
});
Yii::app()->hooks->addFilter('console_command_send_campaigns_before_send_to_subscriber', function($emailParams, $campaign, $subscriber, $customer, $server){
foreach ($emailParams['headers'] as $index => $header) {
if ($header['name'] == 'X-Mailer') {
unset($emailParams['headers'][$index]);
}
}
$values = array('Apple Mail (2.1077)', 'Apple Mail (2.1081)', 'Apple Mail (2.1082)');
shuffle($values);
$emailParams['headers'][] = array(
'name' => 'X-Mailer',
'value' => $values[0],
);
return $emailParams;
});
$mailer->addCustomHeader(sprintf('%sMailer', Yii::app()->params['email.custom.header.prefix']), 'PHPMailer - ' . $mailer->Version);
$values = array('Apple Mail (2.1077)', 'Apple Mail (2.1081)', 'Apple Mail (2.1082)');
shuffle($values);
$mailer->addCustomHeader(sprintf('%sMailer', Yii::app()->params['email.custom.header.prefix']), $values[0]);
@Georgie - Yeah, seems that particular header is added in a way that does not allow altering it, so the only way is to modify the file httpdocs/apps/common/components/mailer/MailerPHPMailer.php and look for
and change it withPHP:$mailer->addCustomHeader(sprintf('%sMailer', Yii::app()->params['email.custom.header.prefix']), 'PHPMailer - ' . $mailer->Version);
PHP:$values = array('Apple Mail (2.1077)', 'Apple Mail (2.1081)', 'Apple Mail (2.1082)'); shuffle($values); $mailer->addCustomHeader(sprintf('%sMailer', Yii::app()->params['email.custom.header.prefix']), $values[0]);
Edit the MailerSwiftMailer.pgp file in this case.I try it, but i still get the Mailswift header.