No offence but you can start by reading the manual, I'm here to help you out, not write your code for you!
Anyways, you'll have to use one of the filesystem functions to read the file (file()) and then loop through each line. Read the mbx first and see if you can figure out the pattern to the end of the emails. But then again since you want to extract email address, this isn't a problem. Just use a regular expression on small chunks of text at a time (use a while loop to break the whole mbx into smaller chunks) and then add each email addy into an array. Then extract all the distinct ones from the array!