James Gray
12/14/2008 11:34:00 PM
On Dec 14, 2008, at 5:20 AM, Adam Akhtar wrote:
> can tmail do this parsing for me, dont really want to reinvent the
> wheel.
Sure can.
> i looked in teh docs and did a bit of experimenting in irb but
> coudnt find a way to specify if i wanted the whole body or just the =20=
> text
> or html parts of it.
I use some code like the following to find the text portion of a =20
message in the Ruby gateway code:
extract_text =3D lambda do |message_or_part|
if message_or_part.multipart?
message_or_part.each_part { |part| extract_text[part] }
elsif message_or_part.content_type =3D=3D "text/plain"
# use message_or_part here=85
end
end
extract_text[message]
Hope that helps.
James Edward Gray II