title: Display each mail body as it is in browser using PHP
body: <pre><code>&lt;?php
      $hostname = '{imap.gmail.com:993/imap/ssl}INBOX';
      $username = 'tnvishwas1@gmail.com';
      $password = '********** ';
      $inbox = imap_open($hostname,$username,$password);
      $emails = imap_search($inbox,'FROM "amithkv32@gmail.com"');
      foreach ($emails as $e){
          $overview = imap_fetch_overview($inbox,$e,0);
          $message = imap_fetchbody($inbox,$e,1);
          echo $message 
      }
  ?&gt;
  </code></pre>
  
  <p>When I tried to run the above code, it's showing like this:</p>
  
  <blockquote>
    <p>Year: 1996 Make: Mercury Model: Villager Drive: Automatic Engine: 3.6
    - 6 Cylinders ----------------------------- Part: Transmission ----------------------------- Name: ABCD Phone: Text: No Email: ABCD@gmail.com Location:  xyz,123456 Notes: A good rebuilt
    transmission</p>
  </blockquote>
  
  <p>Below is the actual format I need and which is same in gmail:</p>
  
  <blockquote>
    <p>Year:   1996</p>
    
    <p>Make:   Mercury</p>
    
    <p>Model:  Villager</p>
    
    <p>Drive:  Automatic</p>
    
    <p>Engine: 3.6 - 6 Cylinders</p>
    
    <p>Part:   Transmission</p>
    
    <p>Name:   ABCD</p>
    
    <p>Phone:</p>
    
    <p>Text:  No</p>
    
    <p>Email: ABCD@gmail.com</p>
    
    <p>Location: xyz,123456</p>
    
    <p>Notes: A good rebuilt transmission</p>
  </blockquote>