Issues

ZF-6554: need to make forward to an existing email

Description

Hi people.

It will be very nice to be able to make forward to an existing email. This will prevent lot of work and bugs like: what will happen if you have an html but set it text? what will happen if you have attachments or is multipart and other.

I searched for this but didnt found anything so please forgive me if this request or feature exists already. Is first time I came here :).

How I see it now:


//take an existing email
$oldMail = new Zend_Mail_Storage_Imap();

//make new Zend_Mail that can accept a Zend_Mail_Storage_xx object
$mail = new Zend_Mail($oldMail);

//set new to
$mail->addTo($oneEmail);

//send
$mail->send();

greets, Alex

Comments

This would be very nice. I also have a project where I need to forward a mail (from imap storage).

Because it is not possible with ZF, I have to do it with PEAR.

Sorry, I have been inactive since last April.

As a short term solution, would object cloning work? [http://php.net/manual/en/language.oop5.cloning.php]


$mail = clone $oldMail;

The problem is when reading a mail from an IMAP server you get a Zend_Mail_Message object, but for sending a mail you need a Zend_Mail object. And there is no easy convert function for that.

Perhaps the problem is now a bit more clear.