PEAR Mail_Mime overwrite header "To"

42 Views Asked by At

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.

0

There are 0 best solutions below