if ($parsed->xpath_exists('//plain')) { @nodes = $parsed->xpath_findnodes('//plain'); $text_part = $nodes[0]; $body=$text_part->body; } #### --=_mixed 007E16738825776F_= Content-Type: multipart/alternative; boundary="=_alternative 007E16738825776F_=" --=_alternative 007E16738825776F_= Content-Type: text/plain; charset="US-ASCII" This was the body text --=_alternative 007E16738825776F_=-- --=_mixed 007E16738825776F_= Content-Type: text/plain; name="6014969_S02500.txt" Content-Disposition: attachment; filename="6014969_S02500.txt" Content-Transfer-Encoding: quoted-printable This is a text file attachment --=_mixed 007E16738825776F_=--