Re: Directly changing To & From field in the header
Mark Overmeer <[email protected]> Tue, 8 Feb 2005 08:22:48 +0100
| Newsgroups | gmane.comp.lang.perl.modules.mail-box |
|---|---|
| Organization | MARKOV Solutions |
| Message-ID | <[email protected]> |
* Vic Norton ([email protected]) [050208 01:17]: > My real question is this. Suppose you have a loop. You send out one > single-part plain-text message in each iteration of the loop. The > header of each message is the same except for a couple of fields. The > body changes slightly depending on who you are sending the mail to. > > Should you create a new mail-message object that starts with the > right head and body in each iteration of the loop? Or should you > create an initial mail-message ahead of the loop and adjust it with > each iteration? You shouldn't change the content of a body. There is some administration around it, which will certainly be messed-up when you do so. On purpose, there are no clean ways to do this in MailBox. Constructing a new message each time will consume a little more time, but will produce the right settings automatically. You can reuse (share) bodies between created messages, if you want some peephole optimization. You can also safely share header fields between messages. -- MarkOv ------------------------------------------------------------------------ drs Mark A.C.J. Overmeer MARKOV Solutions [email protected] [email protected] http://Mark.Overmeer.net http://solutions.overmeer.net