Change Sender Email For Every Mails

Hi ,

I try to globally change the email From adress on every mails sent by cscart .

I register a hook in my_changes plugins in init.php file -- >

if ( !defined(‘AREA’) ) { die(‘Access denied’); }

fn_register_hooks(
‘mailer_send_pre’
);

And add a function in my func.php file -->

<?php 
if ( !defined('AREA') ) { die('Access denied'); }

function fn_my_changes_mailer_send_pre($mailer, $transport, $message, $area, $lang_code){

$mailer->setFrom(‘Myadress@site.com’,‘My new adress’);

}

But when i try to send a mail it does not work , i just get an ajax error ...

Noboby knows how ca i fix it ?