Exhibit 5.1 MIM Corporation One Blue Hill Plaza Pearl River, NY 10965 August 4, 1998 MIM Corporation One Blue Hill Plaza Pearl River, New York 10965-9670 Ladies and Gentlemen: I am the general counsel of MIM Corporation, a Delaware corporation ("MIM"), and have represented MIM as such in connection with the preparation and filing with the Securities and Exchange Commission (the "Commission") under the Securities Act of 1933, as amended (the "Act"), of a Registration Statement on Form S-4 of MIM (File No. 333- )(the "Registration Statement") for the purpose of registering 3,912,448 shares of the common stock, par value $.0001 per share (the "Shares"), of MIM. The Shares are to be issued pursuant to the Agreement and Plan of Merger, dated as of January 27, 1998, as amended (the "Agreement"), by and between MIM, CMP Acquisition Corp., an Ohio corporation wholly-owned by MIM ("Sub"), Continental Managed Pharmacy Services, Inc., an Ohio corporation ("Continental"), and the individuals named as "Principal Shareholders" on the signature pages to the Agreement. In rendering the opinion set forth herein, I have examined executed copies, telecopies or photocopies of (i) the Registration Statement, (ii) the Agreement, (iii) MIM's Certificate of Incorporation, as amended, and (iv) the Amended and Restated By-laws and minute books of MIM. I have knowledge of all proceedings heretofore taken and am familiar with the proceedings proposed to be taken by MIM in connection with the authorization and issuance of the Shares (summarized in the Registration Statement). In my examination, I have assumed the genuineness of all signatures and the legal capacity of all natural persons. On the basis of such examination, subject to the assumptions set forth above, and having regard for such legal considerations as I have deemed relevant, I am of the opinion that, upon approval of the merger of Sub with and into Continental, whereby Continental would become a wholly-owned subsidiary of MIM, by the respective stockholders of MIM and Continental in accordance with the terms and conditions set forth in the Agreement, and the issuance and delivery of the Shares in accordance with the terms and conditions set forth in the Agreement, the Shares will be duly authorized, validly issued, fully paid and non-assessable. I hereby consent to the filing of this opinion as an exhibit to the Registration Statement. Respectfully submitted, /s/ Barry A. Posner General Counsel