Advice for email mungingby Limbic~Region (Chancellor)
|on Jun 03, 2003 at 23:46 UTC||Need Help??|
Limbic~Region has asked for the wisdom of the Perl Monks concerning the following question:
I am looking for a way to modify an email message in transit. In all cases I will be modifying the "to", "from", and some other headers. In some cases - I will be removing a string from the body of the message. In other cases - I will be adding a string to the body of the message.
Ok - you get the idea - I munge the data, so what's the problem? I am not sure how to handle MIME body correctly. What I would like to say is:
I thought I was pretty close until I encountered "Content-Type: multipart/alternative;". There are basically multiple pieces to the body (in my case plain text and HTML). The email client chooses the one it likes.
I am grateful for any help that I can get, but what is most desireable is a working template. I can handle modifying all the headers - it is the body and specifically MIME body that is causing me grief.
Thanks in advance - L~R