On the 13th day of January, 1903, plaintiff, a foreign corporation, commenced this action on contract in file-name of William B. Graham and Alonzo L. Utz, as copartners doing business under the firm name and style of the American Copying Company, but, after the answer was served and the case noticed for trial at the June, 1903, term, leave was applied for and obtained to amend the verified complaint bjr alleging plaintiff's corporate-capacity by virtue of the laws of Illinois. By the terms of such-contract, which was executed in this state September 8, 1902, with-reference to a trading stamp scheme, the defendant, a retail mcr-*529chant, was obligated upon certain conditions to pay 50 cents per 100 for all stamps required and $175 for' 100 picture frames designed to be given with portraits to customers purchasing $25 worth of goods at his store. It was conclusively shown that plaintiff had not at the time of making the contract, nor when the action was commenced, complied with the statute prohibiting a nonresident corporation from transacting any business, acquiring or disposing of any property, instituting or maintaining any action at law, or otherwise on any contract made in this state, unless its articles of incorporation shall have been filed in the office of the Secretary of State and a resident agent appointed upon whom service of process may be had. Sections 883-885, Rev. Civ. Code.
In the early case of Wright v. Lee, 2 S. D. 596, 51 N. W. 706, the only question relating in the slightest degree to the point now under consideration was whether a foreign corporation doing business in this state, without complying with the statute as it then existed, could make an assignment for the benefit of creditors, and, upon the anomalous theory that the Legislature did not intend to give our citizens the right to1 question the unlawful acts of foreign corporations, and that none but the sovereign state could complain, the assignment was held valid. Although the case covers 34 closely printed pages, composed principally of citations and quotations from nearly all the states to the effect that foreign corporations are prohibited from transacting business therein until they have complied with the terms upon which permission is granted, and that contracts in violation of a statute are void, the reasoning of the opinion is at variance with all the authorities, and, while thp conclusion that a delinquent foreign corporation may make an assignment for the benefit of creditors is now considered to be well settled, neither of Judge Bennett’s associates concurred in the proposition, and Judge Corson declined to express an opinion with reference thereto. That no question as to the right of a foreign corporation to transact business or maintain an action in this state was then before the court •is clear from the fact that the making of an assignment in this state, by officers elected in this state, for the benefit of creditors in this state, was not within the statutory prohibition, and in no sense is *530that case an authority bearing, even remotely, upon the question now before us.
From a most exhaustive article on the law of corporations written for 19 Cyc., at page 1280, by Judge Seymour D. Thompson, we quote as follows: “The doing of matters of which the ordinary business of a foreign corporation does not consist, but which it does in the exercise of its general rights for the purposes of its safety, or in order to do.justice to its creditors, or to comply with some other provision of the local law, are not the ‘doing of business, within a state, within the meaning of statutes like those under consideration; but, under a sound interpretation of such statutes, the doing of business consists only of carrying on the operations of its trade for the making of profit. It is accordingly held that there is no doing of business in the state, within the meaning of such statutes, where foreign corporations make an assignment of their property for the benefit of their creditors, or confess a judgment in favor of a particular creditor.” In discussing the question vitally pertinent to every court called upon to construe a statute like ours the same distinguished jurist and author, as late as the year 1904, says: “If, as is sometimes the case, the statute expressly declares that all contracts of á foreign corporation in violation thereof shall be void, or that no1 action shall be maintained thereon, then of course there is no doubt as to the intention of the Legislature, and there can be no recovery thereon by the corporation.” 19 Cyc. 1292. Speaking further, and to the point that when a statute provides that foreign corporations shall do no business within the state except upon compliance with the statute, Judge Thompson says: “When such corporation does business in the state in violation of the statute, and, through the business so done, a con-traer accrues to it which would otherwise be enforceable in the courts of the state, the corporation cannot, because of the statutory prohibition maintain an action upon such contract in the courts of the state.” In support of the proposition he cites numerous cases in the notes from each of the following states: Alabama, Colorado, Illinois, Indiana, Kentucky, Massachusetts, Michigan, Minnesota, Missouri, Nebraska, New Hampshire, New Jersey, North Carolina, Oregon, Pennsylvania, Tennessee, Texas, Utah, Vermont, Wiscon*531sin, United States and the provinces of Canada. 19 Cyc. 1289 to 1291, incl.
Construing a statute of Colorado enacted in 1901, and. which does n t in terms prohibit the institution of an action based on a contract in violation of such, provision, the federal court, in the case of U. S. Rubber Co. v. Butler Shoe Co. (C. C.) 132 Fed. 398, say: 'Complainant could sell its goods to respondent or to any ■other purchaser without paying tribute to the state. But, when they brought goods into the state to be sold in the general market, they became subject to the general law of the state in respect to foreign corporations. Not having complied with the act of .assembly of 1901, it must be said that they have no right of action upon the contracts mentioned in the bill of complaint. It matters not that the act of assembly does not declare the contracts to be void, and when the plaintiff cannot establish a cause .of action without relying upon an illegal contract he cannot recover. Miller v. Ammon, 145 U. S. 421, 12 Sup. Ct. 884.” From the headnote, fully sustained by the opinion, in New Hope Delaware Bridge Co. v. Poughkeepsie Silk Co., 14 N. Y. Common Law Rep. 648, we.quote as follows: “A foreign corporation keeping an office in this state for receiving deposits, and discounting notes without being expressly authorized by the laws of this state to do so, cannot maintain an action for the money loaned either on a nóte or other security taken on such loan, or on the count for money lent.” In the very recent case of South Amboy Terra Cotta Co. v. Poerschke 90 N. Y. Supp. 333, it is said: “A foreign corporation doing business in New York, and having a regular place of business there, at which its directors met, and its books and most of its money were kept, and at which contracts and payments were made, cannot maintain a suit on a contract made in New York prior to a compliance with the General Corporation Law, Laws 1892, p. 1805, c. 687, §. 15, as amended by Laws 1901, p. 1326, c. 538, declaring that no foreign corporation shall maintain an action on any contract made in the state, unless, before making it, it shall have procured a certificate from the Secretary of State, and the fact that it obtained the certificate before the commencement of the suit was insufficient.” Weisbach Co. v. Norwhich Co., 96 App. Div. 52, 89 N. Y. Supp. 284.
*532It is stated in the decision of Wright v. Lee, supra: “That a contract prohibited by statute is void, and if a statute provides a penalty for doing an act, any contract under such a statute is invalid, whether it be so declared or not. * * * There can be no-doubt of the power of the Legislature to prescribe the terms and conditions upon which a foreign corporation may do business in this state. That consent may be upon such terms and conditions, as the Legislature, under its lawmaking power, may impose, and they may be excluded altogether, if thought to be wise. Before exercising their franchises, such corporations, must comply with the conditions imposed.” While it was incidently said that a failure to comply with sections 3190, 3192, Comp. Laws Dak. 1887, did not render the acts of foreign corporations void, the subject is reviewed at great length, and, as the opinion is very instructive and an authority favorable to our view, we further quote as follows: “In Oregon, section 8 of the act of October 2x, 1864, provides: 'A foreign corporation before transacting business in this state must duly execute and acknowledge a power of attorney, and cause the same to be recorded in the county clerk’s office of each county where it has a resident agent.’ The purpose of this requirement is declared, in the ninth section of the act, to secure the appointment of an attorne)'’ authorized to receive service of process so as to enable the citizens or inhabitants of Oregon to sue in the .courts of that state, thereby avoiding delay and expense in any litigation that may be necessary with such foreign corporations. This law was construed by the United States court for the district’ of Oregon in the case of In re Comstock, 3 'Sawy. 218, Fed. Cas. No. 3,078. In that case Judge Deady, in an exhaustive- opinion, says: “Two questions appear to- rise: (1) Does the Oregon statute prohibit the transaction of business therein by a foreign corporation until its requirements are complied with? (2) Is the assignee estopped to. show a want of compliance by the bank with the statute because the bankrupts were parties to the transaction alleged to have been done in violation of it?’ After stating the principles of law in relation to foreign corporations transacting business outside their own domicile, as laid down in Bank v. Earle, and Story in his Conflict 01 Laws, supra, and those approved by Mr. Justice Field in Paul *533v. Virginia, 8 Wall. 181, and in the case of Lafayette Ins. Co. v. French, 18 How. 407, and Ducat v. City of Chicago, 10 Wall. 410, he says: ‘The bank, then, has no power to make a contract within this state without its permission or consent. If the state is silent on the subject, by the comity of nations its permission is presumed, unless it would be contrary to its policy or interest. But the state has spoken .on the subject and given its consent to the transaction of business within its jurisdiction by the bank, not absolutely, but upon a condition or limitation. This condition or limitation is found in the first clause of section 8 of the act aforesaid. * * * The state, having this right to permit the bank to do business within its limits or not, with or without terms, has seen fit, for the security of its citizens, to require the execution and record of this power of attorney before the transaction of such business. * * * It follows, of course, from these premise's, that the bank had no. power to contract in the state until it had complied with the terms upon which the permission to do business was-granted. It was required to perform the condition before it transacted business. But it is said that this statute is directory, and therefore the acts of the foreign corporation, done in disregard of it, are not illegal and void. It is the duty of a court to give effect to the intention of the Legislature as far as practicable,' and such intention should-be ascertained from the words used in the statute and the subject-matter to which it relates. The words of this act are certainly mandatory in form. Before transacting any business the corporation must appoint an attorney. Language could not be plainer. ^The purpose of the act is apparent. As has been said, it is to secure the people of the state the right to sue the foreign corporation in the courts of the state; but, unless the attorney is appointed before the business is transacted, it will not be attained.’ The court then held the contract under consideration illegal and void. In the case of Semple v. Bank, 5 Sawy. 88 Fed. Cas. No. 12,659, Judge Deady, again construing thé same statute, reaffirmed his former decision in more emphatic terms, if possible.'* * * In Illinois it was enacted that: Vt shall not be lawful for any agent or agents of any insurance company incorporated by any other state than the state of Illinois, directly or indirectly, to take risks or transact any business of in*534surance in this state without first producing a certificate of authority from the auditor of the state/ Pub. Laws 18^. p. 46. The-statute also imposed a penalty for a violation of its provisions. The Supreme Court held that a promissory note, given to an insurance company which had not complied with the statute, was void, and could not be enforced. Assurance Company v. Rosenthal, 55 Ill. 85, 91. Justice Walker, in delivering the opinion, says: ‘When the Legislature prohibits an act, or declares that it shall not be lawful to perform it, every rule of interpretation must say that the Legislature intended to interpose its power to prevent the act, and, as-one of the means of its prevention, that the courts shall hold it void. This is as manifest as if the statute had declared that it should be void/ See, also, Pierce v. State, 106 Ill. 11. The same rule was applied in Wisconsin under a similar statute. Insurance Co. v. Harvey, 11 Wis. 394. In Indiana an act applicable to foreign corporations provides that: “Such foreign corporations shall not enforce in-any of the courts of this state any contract made by their agents, or by persons presuming to act as their agent, before compliance * * * with the provisions of sections 1 and 2 of this act/ It was decided' by the Supreme Court that, while contracts made by foreign ‘ corporations which had not complied with the statute were valid, the corporation could not sue on such contracts until after the' statutory requirements had been fulfilled, and that the company’s right to sue must be pleaded in abatement. Mowing, etc., Co. v. Caldwell, 54 Ind. 270; Smith v. Little, 67 Ind. 549; Daly v. Insurance Co., 64 Ind. 1; Manufacturing Co. v. Effinger, 79 Ind. 264; Elston v. Piggott, 94 Ind. 14. This act was superseded, as to foreign corporations, by the act of 1865, which prohibits such companies and their agents from doing business within the state until certain conditions had been complied with, and'a certificate obtained from the auditor of the state. It was decided by the Supreme Court that this statute did not merely affect the right to sue in the courts of the-state, but that contracts made before complying with the prescribed conditions' were absolutely void by force of the statute. Hoffman v. Banks, 41 Ind. 1; Insurance Co. v. Thomas, 46 Ind. 44. In Massachusetts, Pennsylvania, Michigan, and Kentucky, a similar doctrine has been laid down in their courts construing statutes re*535lating to foreign corporations. Roche v. Ladd, 1 Allen (Mass.) 436; Insurance Co. v. Pursell, 10 Allen (Mass.) 231; Williams v. Cheney, 3 Gray (Mass.) 215; Insurance Co. v. Harvey, 11 Wis. 394; Brackett v. Hoyt, 29 N. H. 264; Buxton v. Hamblen, 32 Me. 448; Bancroft v. Dumas, 21 Vt. 456; Thorne v. Insurance Co., 80 Pa. 15, 21 Am. Rep. 89; Scott v. Duffy, 14 Pa. 20; Insurance Co. v. Stoy, 41 Mich. 385, 1 N. W. 877; Pierce v. People, 106 Ill. 11; Franklin Ins. Co. v. Louisville & A. Packett Co., 9 Bush. (Ky.) 590.”
Thus enlightened by the declarations of this court concerning legislative power to protect our citizens from gross imposition, by requiring every foreign corporation to put itself upon equal footing with domestic corporations, in order to lawfully transact business in this state, the Legislature of 1895, declaring an emergency to exist, amended the statute by adding to- the existing restrictions as to the transaction of business that “No corporation created or organized under the laws of any other state or territory shall * * * sue or maintain any action at law or otherwise, in any of the courts of this state until such corporation shall have filed in the office of the Secretary of State a duly authenticated copy of its charter or articles of incorporation. * * * Provided, that no action shall be commenced or maintained in any of the courts of this state by such corporation on any contract , agreement or transaction made or entered into- in this state, by such corporation, unless such corporation shall have fully complied with the provisions of this article. Provided, further, that it shall be unlawful for any person to act within this state as agent or officer of any foreign corporation unless such corporation shall have appointed an agent as hereinbefore provided, and every person so acting as such agent "or officer of any such corporation shall be deemed guilty of a misdemeanor, and upon conviction thereof shall be fined not less than ten nor more than one hundred dollars and imprisoned in the county jail not less than ten nor more than thirty days, or' both such fine and imprisonment at the discretion of the cofirt. That justices of the peace shall have concurrent jurisdiction with the circuit courts to hear and determine any criminal action arising under the provisions of this act.” In a recent case, where one of *536our citizens found a corporation in another state from which he purchased certain building material, it was held that such ’isolated transaction was not absolutely void, but, in the language of the statute, the right to resort to our courts for the enforcement of its claim was suspended “until such corporation shall have filed in the office of the Secretary of State a duly authenticated copy of its charter or articles of incorporation,” and “shall appoint an agent who shall reside at some accessible point in this state duly authorized tO' accept service of process. * * *” In discussing the question, we say: “In requiring the filing of corporate articles and the appointment of an agent'as a condition precedent to the commecement of an action in any court of this state by a foreign corporation to enforce a claim arising in another state, the Legislature has used the plainest of words in sentences free from ambiguity, and whether an action is maintainable, on account of a transaction entered into in this state by such corporation prior to complying with the statute, is a question not now presented "for determination, and concerning which no opinion is expressed. However, it is noticeable that section 883 of the Revised Civil Code provides generally that no action is maintainable by a foreign corporation until its articles are filed and an agent appointed, while section 885 specifies that no action is maintainable ‘on any contract, agreement or transaction made or entered into in this state by such corporation, unless such corporation shall have fully complied with the provisions of this article.’ ” Iowa Falls Mfg. Co. v. Farrar, 19 S. D. 632, 104 N. W. 449.
Manifestly" it was the intention of the Legislature to presently subject every foreign corporation, upon coming into this state, to exercise its franchise to all the duties and liabilities imposed upon similar domestic corporations, and nothing short of a compliance with the statute before the contract, agreement or transaction sought to be enforced was made or entered into' will entitle a corporation to commence or maintain an action in any of the courts of this state. This purpose has been effectuated by making such unauthorized acts criminal and by the use of the following phrase, the grammatical tense of which always denotes an act completed before the performance of some other act: “Unless such corporation shall have fully complied with the provisions of. this .article.” Under statutes *537providing no penalty for their violation, and otherwise much less favorable to this view than our own, the courts have uniformly held that the right of action is lost, unless the statute was complied with before the contract sought to be enforced was entéred into. Delaware R. Q., etc., Co. v. Pass Ry. Co., 204 Pa. 22, 53 Atl. 533; Brewing Co. v. Peimeisl, 85 Minn. 121, 88 N. W. 441; Assurance Co. v. Rosenthal, 55 Ill. 85, 8 Am. Rep. 626; Loan Co. v. Eyer, 87 N. W. 1058; Seamans v. Temple Co. (Mich.), 63 N. W. 408, 28 L. R. A. 430; Plow Co. v. Wyland, 76 Pac. 863; Driller Co. v. Superior Court of San Francisco, 72 Pac. 398; Hanchey v. Loan Ass’n (Ala.), 37 South. 272; Diamond Glue Co. v. U. S. Glue Co., 187 U. S. 611, 23 Sup. Ct. 206. Adhering to the doctrine announced in Uhlig v. Garrison, 2 Dak. 71, and Wright v. Lee, supra, to the effect that no action is maintainable to enforce a contract which is unlawful or contrary to public policy, it was held by a majority of this court, in Johnson v. Berry, 104 N. W. 1114, that no recovery •could be had for threshing grain pursuant to a contract made and performed in violation of the statute requiring the owner of a threshing machine to enter into a certain bond, and the conclusion reached in that case is alone sufficient to justify the action of the trial court' . now undv-i consideration. In Miller v. Ammon, 145 U. S. 421, 12 Sup. Ct. 884, 36 L. Ed. 759, Mr. Justice Brewer, speaking for the undivided court, says: “The general rule of law is that a contract made in violation of • a statute is void, and that, when a plaintiff cannot establish his cause of action withou relying upon an illegal contract, he cannot recover. Pol. Cont. pp. 253 to 260; Penn v. Bornman, 102 Ill. 523; Alexander v. O’Donnell, 12 Kan. 608; Gunter v. Leckey, 30 Ala. 591; Kennedy v. Cochrane, 65 Me. 594; Bank v. Owens, 2 Pet. (U. S.) 527, 539. 7 L. Ed. 508; Pangborn v. Westlake, 36 Iowa, 546, 549; Harris v. Runnels, 12 How. (U. S.) 79, 84, 13 L. Ed. 901. In Bank v. Owens, this court said: “There can be no civil right where there can be no legal remedy, and there can be no legal remedy for that which is itself illegal.’ ”
Notwithstanding such legislative injunction, the violation of which is made a public offense punishable by fine or imprisonment, plaintiff procured this forbidden contract, by its terms performable In this sate, but which was rendered inoperative and void both by *538express statute and a rule of public policy prohibiting its enforcement. Clearly then, the filing of corporate articles and appointing an agent after making such contract and commencing this action, was ineffectual to give the transaction any validity, while the answer of the defendant was amply sufficient to present the question, for review.
The judgment dismissing the action entered upon a verdict di- « rected against plaintiff is therefore affirmed.
HANEY, J.In my opinion the defense based on plaintiff’s, failure to comply with our law relating to foreign corporations is. not properly pleaded, but the plaintiff is not in position to question the sufficiency of the answer, not having attacked it in the court below, and having itself introduced the evidence upon which the verdict was directed. Such evidence disclosed that' the contract .sued upon was made, and this action was begun before the plaintiff complied with the statute, and that the contract was executed and to-be performed in this state. Such being the undisputed facts, the plaintiff is without remedy in the courts of this state, for the reason that a foreign corporation cannot commence or maintain any action at law or otherwise, until it shall have complied with the statute, and it cannot commence or maintain an action on any contract made in the state unless it shall have full}'- complied with the-statute. Rev. Civ. Code, §§ 883, 885. In other words, -before transacting any business or bringing any suit in this state, it must, comply with its laws. If the contract is one made in another state, it only has to comply before bringing the suit. If the contract is one made in this state it must comply before making the contract. The statute has been modified since Wright v. Lee was decided. Laws 1895, p. 52, c. 47. The legislative intent is clear. A foreign corporation can do no lawful act, acquire no right, or demand any recognition in this state before it has complied with its laws which are just and reasonable. For tliese reasons. I concur in the conclusion that the judgment of the circuit court should be affirmed.