title: Extract email addresses list from inbox using PHP and IMAP
body: <p>Has anyone had this task ??</p>
  
  <p>It should be common.
  I need to extract all the email addresses from a specific inbox 
  accessible through imap. It's for marketing purposes (SMB, mailchimp).
  The addresses can be either in "from" or somewhere in the body.</p>
  
  <p>Strange but I have not found anything similar except these ones:
  <a href="https://stackoverflow.com/questions/4272551/extract-body-text-from-email-php">Extract body text from Email PHP</a>
  <a href="https://gist.github.com/AikChun/8305789" rel="nofollow noreferrer">https://gist.github.com/AikChun/8305789</a></p>
  
  <p>This link is also useful for the task
  <a href="http://www.php.net/manual/en/function.imap-headerinfo.php#98809" rel="nofollow noreferrer">http://www.php.net/manual/en/function.imap-headerinfo.php#98809</a></p>
  
  <p>So I am writing the script now. I am going to place it on github and on my website <a href="http://lycenok.com" rel="nofollow noreferrer">http://lycenok.com</a>. </p>
  
  <p>Regards, Eugene.</p>