There is nothing in the act entitled, ‘-‘An act, to give force and effect to section 4 of Article XIV of the constitution of the State of Alabama” (Acts, 1886-87, p. 102), which changes the general rule that contracts prohibited by statute under a penalty, while not enforceable so long as they remain executory, (Youngblood v. Birmingham Trust Co., 95 Ala. 521; Hawley v. Bibb, 69 Ala. 52), are not assailable after they have become completely executed by the parties. This rule is one of general recognition in the law. It rests upon the well known principle that the law leaves parties who are in pari delicto, in respect of their transactions, where they place themselves. This is a real action under the Code, the plaintiff relying upon a title acquired by mortgage executed by the defendant to a foreign corporation, who took the mortgage in this State without complying with the provisions of said act. The mortgage contained a power of' sale and, under it, was foreclosed, the plaintiff, for the use of the mortgagee, becoming the purchaser at the foreclosure sale and receiving the deed of the mortgagee in due form. All this occurred before the institution of the present action. Under the influence of Sherwood v. Alvis, 83 Ala. 115, and the line of cases following that decision, cited on the brief of appellant’s counsel, the mortgage thus became a completely executed conveyance, and must be treated, for the purposes of this case, as though it had been an absolute, uncon*155ditional deed from its inception. — Richardson v. Stephens, 114 Ala. 238; Shahan v. Tethero, 114 Ala. 404.
It is wholly immaterial that the mortgagee became, by and through the plaintiff, the purchaser at the foreclosure sale, whereby the sale was voidable at the election of the mortgagor seasonably expressed. It rested in the discretion of the mortgagor to affirm or dis-affirm the sale, and until disaffirmed by him by bill in equity, the foreclosure was as valid and binding as if a stranger had been the purchaser. — McCall v. Mash, 89 Ala. 487; Amer. F. L. Mortgage Co. v. Sewell, 92 Ala. 163.
The legal title to the land only is involved in this action. The right to disaffirm the voidable sale can be asserted only in a court of equity. It cannot be regarded in a court of law. The mortgage having been foreclosed, thereby becoming, under our decisions, a completely executed conveyance, so as to cut off all cause of attack on the ground that the corporation had not complied with the constitution and the act passed to enforce it, in reference to having an agent or agents in this State, etc., the plaintiff in the case was invested with a perfect legal title and was consequently entitled to recover.
The cases of Craddock v. Amer. F. L. Mortgage Co., 88 Ala. 281 and Gamble v. Caldwell, 98 Ala. 577, cited as tending to militate against the views above expressed, will, upon examination and proper application, be found to be in harmony with what we have said.
Reversed and remanded.