in reply to Re^6: MIME voodoo.
in thread MIME voodoo.

Any ideas why it only returns the plain text portion, and no html?

Sure ;) Look at this, here are four returns and first always works:

#this one returns you text/plain part return $ct{'text/plain'} if exists $ct{'text/plain'}; # and these are not executed it there's text/plain part return $ct{'text/html'} if exists $ct{'text/html'}; # these are not executed at all an they are not correct! # parts[0] may contain text/html and parts[1] text/plain return $parts[0] if $which =~ /text/; return $parts[1] if $which =~ /html/