currently I'm working on a plugin for Roundcube using some functions of Mail_Mime.
At one point I have to replace the recipient of the mail with another one, so I use
$message->get();
$message->headers(array('To'=>implode(',', $recipients)), true);
This code is doing well. But there still is the "Envelope-To"-Header, so the mail will never reach the correct recipient. I can't replace it like follows:
$message->headers(array('To'=>implode(',', $recipients), 'Envelope-To'=>implode(',', $recipients)), true);
Can anyone help? I'm stuck with this.