<?php
$imap = imap_open("{mail.stvat.com:995/pop3/ssl/novalidate-cert}", "data@stvat.com", "Datastvat@123");

if( $imap ) {
   
     //Check no.of.msgs
     $num = imap_num_msg($imap);

     //if there is a message in your inbox
     if( $num >0 ) {
          //read that mail recently arrived
          $body = imap_body($imap, $num);
          
        // $body = trim(substr(quoted_printable_decode($body), 0, 100));
        $index = strpos($body, 'quoted-printable');
        $last = strpos($body, '--000');
        // echo $last;
        $body = substr($body,$index);

        if($last === false){

        }
        else{
            // $body = substr($body,16,$last);
        }

        
          echo imap_qprint($body);
     }

     //close the stream
     imap_close($imap);
}
?>