ok i got that working, by doing the following
chomp(@to,@cc);
@recipients = (@to,@cc);
@recipients = join ("",@recipients);
$recipients = @recipients[0];
@recipients = split (",",$recipients);
$recipients = join ("','",@recipients);
The only thing is with this i get the following output...