I'm using Swift Mailer to send mail to a fairly large list of email addresses. The message is customized slightly for each recipient. Some placeholders are replaced with unique text.
I assumed it would be more efficient (less garbage collection etc) to reuse one instance of Swift_Message
multiple times. I just setTo()
, setBody()
and send again to the next address.
That works well with a single part body, usually just html. But ... when I want a second part, usually text, I can do addPart()
, but next time around the loop, that will add another part, and then another part etc ... The problem doesn't happen with setBody
because that overwrites the existing body.
Is there a way to overwrite or remove an existing part?
Thanks