Please bottom post...
Mike Blezien wrote:
This is what comes in the body of the email message if it's not plain text message and need to pass the email with the right headers so it's displayed correctly when received:
Right, but the message itself is MIME and multipart. So I don't understand from your original question why you would be dropping either part? Shouldn't both parts continue on to their destination? I am still not understanding why you would need to know what the content type is of either part, since it is still just a single message. If the destination is MIME compliant it will read one, if not then it will read the preamble (and display it all), seems like you would still want them both? If you are trying to have it decide which then you would need to know apriori what the client can handle, and in the case of non-MIME you would drop everything not text, but that depends on knowing the client.
Which still gets back to the original point that only you can tell us if you want to drop the HTML or not.
I don't have specific sample code, can look into it but still trying to understand specifically what you are looking for. Maybe stepping back and looking at the problem as a whole, again, would help?
http://danconia.org
Message Body content:
This is a multi-part message in MIME format.
------=_NextPart_000_0013_01C4419E.02807DF0 Content-Type: text/plain; charset="US-ASCII" Content-Transfer-Encoding: 7bit
*****Sent from [EMAIL PROTECTED] to [EMAIL PROTECTED]
------=_NextPart_000_0013_01C4419E.02807DF0 Content-Type: text/html; charset="US-ASCII" Content-Transfer-Encoding: quoted-printable
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> <HTML><HEAD> <META HTTP-EQUIV=3D"Content-Type" CONTENT=3D"text/html; charset=3Dus-ascii"> <TITLE>Message</TITLE>
<META content=3D"MSHTML 6.00.2800.1400" name=3DGENERATOR></HEAD> <BODY> <DIV><SPAN class=3D255234621-24052004><FONT face=3DArial>Sent from <A=20 href=3D"mailto:[EMAIL PROTECTED]">[EMAIL PROTECTED]</A> to = <A=20 href=3D"mailto:[EMAIL PROTECTED]">[EMAIL PROTECTED]</A></FONT><= /SPAN></DIV></BODY></HTML>
------=_NextPart_000_0013_01C4419E.02807DF0--
End of the message
TIA, Mike
Wiggins d Anconia wrote:
Hello,
we're currently using the Mail::Audit module to process a perl script
that pipes
email sent to "fake" forward emails address, then send it's to a real address,... all works fine except if it's a HTML formatted email. My
question
is, is it possible with this module to determine if it's HTML or plain
test
email... or would it be better to simple strip out all the HTML elements.
It appears that Mail::Audit provides a wrapper to a message, if that message is of a MIME format (which most if not all HTML messages will be) then you can check the type of the message, and process its various parts using the MIME::Entity methods. Only you can tell us whether or not your users want their HTML e-mail. I know I would be more than a little pissed if my HTML e-mail ended up in the bit bucket, not because I am any big fan of HTML e-mail (I am not) but (much to my dismay ;-)) I don't control everyone elses mail clients or sending habits...
What do you mean by "all works fine unless it has HTML"... the module, your program, or something down the line?
http://danconia.org
-- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] <http://learn.perl.org/> <http://learn.perl.org/first-response>