Details
Description
I would suggest to add a function "clearRecipients()" to Zend_Mail. It allows one to send personalised mails to more than one recipient without creating a new mail object each time:
public function clearRecipients() { $this->_to = array(); $this->_recipients = array(); unset($this->_headers['To']); unset($this->_headers['Cc']); unset($this->_headers['Bcc']); }
So it's possible to do something like this:
- create mail object, set subject and so on
- add recipient
- set mail text to something like "Dear Mr Miller, ..."
- send mail
- clear recipients
- add new recipient
- set mail text to something like "Dear Mrs Miller, ..."
- send mail
...
Issue Links
| This issue duplicates: | ||||
| ZF-1626 | Add methods for removing or replacing headers |
|
|
|
I'm not sure how useful this is. What you want to do can be solved by just creating a new Zend_Mail object. The only property you don't change (or maybe you just didn't mention it) is the subject. As long as you reuse the transport (if you're using SMTP) sending multiple mails is not a problem. But maybe I'm just missing something?!