sub printPartt() { my $top = $_[0]; my $ent; my $i = 0; my $main_header = $top->head->as_string; # if is one part message it shoudl be an text/plain if(!$top->is_multipart) { my $main_body = $top->bodyhandle->as_string; } else { # go in foreach for all parts fo that message foreach $ent ($top->parts_DFS) { if ($ent->bodyhandle) { # that part should be save on disk if(defined($ent->head->mime_attr("content-type.name"))){ print "\n\n to disc:",$ent->head->mime_attr("content-type.name"),"\n\n"; } else { print "\n\n not to disc \n\n"; } } } } }