Hi Sabu,

> was doing is that once I detect that the email does not have a
> content-type:text/plain then I search for </BODY> and do the replacement
on
> the contents. (I know this is a very trivial and a simplistic approach but
I
> am just getting to grips with this)
>
> Sadly, this approach does not work. I think the multpart boundaries must
be
> getting upset because the html gets all garbled when it arrives back at
the
> email client.

Usually HTML is encoded in a quoted-printable encoding when it is put into a
mime email message. In this case, to carry out your approach, you should
decode the quoted-printable HTML (which my routines do), do your text
replacement based on </BODY>, then encode the result using the
quoted-printable encoding and replace that part in the original email. Then
hope, that the multipart boundary is still valid (ie it is not part of your
new quoted-printable encoded HTML). The content-transfer-encoding header
will tell you if you have quoted-printable encoded data.

>
> I've tried using Brett Handley's excellent routines at
www.codeconscious.com
> to get the structure of a mime-email. I know how to read the structure.
But
> I havent figured out how to write back the structure after the
> modifications. Any help would be appreciated

Umm, yeah I never quite got around to the writing back part. :-/

Regards,
Brett.

-- 
To unsubscribe from this list, just send an email to
[EMAIL PROTECTED] with unsubscribe as the subject.

Reply via email to