use Email::MIME; if(my $parsed = Email::MIME->new($rawmessage)) { my $absender = $parsed->header('From'); my @parts = $parsed->parts; my $textinhalt; for my $part (@parts) { if(scalar @{$part->{'parts'}} > 0) { for my $part (@{$part->{'parts'}}) { next if($part->content_type =~ m#text/html#); $textinhalt .= $part->body; } } } }