
122 Cal.App.2d 731 (1954)
LANSING K. TEVIS, Respondent,
v.
G. ARTHUR BLANCHARD, Appellant.
Civ. No. 15531. 
California Court of Appeals. First Dist., Div. One.  
Jan. 25, 1954.
 Henry C. Clausen and Richard G. Burns for Appellant.
 Cooper, White & Cooper, Sheldon G. Cooper, George A. Helmer and Robert A. Raymer for Respondent.
 WOOD (Fred B.), J.
 Plaintiff Lansing K. Tevis recovered judgment upon a promissory note in the principal sum of $5,000 against defendants Brunner Blanchard Manufacturing Company, Inc., a corporation, as maker, and G. Arthur Blanchard as guarantor. Blanchard has appealed from the judgment and from an order denying his motion for judgment notwithstanding the verdict. He claims the note is void either as a security illegally issued or as representing an illegal advance upon the purchase of stock of the defendant corporation in the absence of a permit therefor.
 The facts developed at the trial present that issue. Some of the evidence of illegality was adduced by Tevis and some by Blanchard. Tevis erroneously claims that illegality was not in issue because not specifically presented by the pleadings and that Blanchard, by tendering this issue upon appeal, is shifting from the theory upon which the case was properly tried.
 Tevis directs attention to the fact that defendants' pleadings, filed over 2 1/2 years prior to trial, did not present such an issue. He claims that defendants' request to amend their answer to present this issue, made at the outset of the trial, was properly denied by the trial court, as not having been promptly tendered, and that the case was not tried on the theory that any such issue was involved. That might be *733 a correct view of the situation if it were a mere dilatory plea, or one personal to the pleader as distinguished from one which is a matter of public interest and concern. [1] A contract proscribed by law is against public policy, is of public interest and concern. "The law is very well settled that where the defendant does not set up the defense of illegality, but the case made by the plaintiff or the defendant shows illegality, it becomes the duty of the court, sua sponte, to refuse to entertain the action." (Dean v. McNerney, 91 Cal.App. 206, 208 [266 P. 975]; approved in Endicott v. Rosenthal, 216 Cal. 721, 728 [16 P.2d 673].) [2] Accordingly, "if the case presents one of illegality of the contract, it must be considered by the court whether pleaded or unpleaded." (P. 210 of 91 Cal.App.) (See, also, Morey v. Paladini, 187 Cal. 727, 733 [203 P. 760]; Force v. Hart, 209 Cal. 600, 604-605 [289 P. 828]; Fewel & Dawes, Inc. v. Pratt, 17 Cal.2d 85, 91-92 [109 P.2d 650], defendant in his answer denied liability under the contract, introduced evidence showing illegality, and moved to vacate the judgment and for judgment in his favor on the ground of illegality; Loving & Evans v. Blick, 33 Cal.2d 603, 607 [204 P.2d 23]; Grimes v. Nicholson, 71 Cal.App.2d 538, 542- 543 [162 P.2d 934], principle recognized but found inapplicable when issue raised for first time on appeal, and entirely new theory from that on which tried; Dealey v. East San Mateo Land Co., 21 Cal.App. 39, 42, and 43 [130 P. 1066], the pleading of a fraud against the public is not a condition precedent to a court taking cognizance of that fraud.) In Dean v. McNerney, supra, after some testimony had been given tending to show that defendant had received the money in suit as a part of an illegal transaction, defendant asked leave to amend her answer to present that issue. That request was denied. But there was evidence of facts which would support a finding of illegality, which made illegality an issue in the case without any pleading on the subject. Hence, the refusal of the trial court to permit the amendment was deemed nonprejudicial. It happened that the trial court later did entertain the issue. It found that decedent Peter W. Dean had delivered to the defendant "in trust for safekeeping and for no other purpose, the sum of $8,000.66, and that said defendant Nell McNerney promised to repay said sum to the said Peter W. Dean, deceased, upon his request or demand." (Pp. 208-209 of 91 Cal.App.) "This finding," said the appellate court, "is to the effect that the money in question was delivered by the deceased to the appellant *734 for safekeeping, and for no other purpose, and therefore was not delivered in accordance with the claim of the appellant that it was for the purpose of protecting her as a house owner consenting to the use of the premises belonging to her, for illegal purposes." (P. 209 of 91 Cal.App.) The appellate court then reviewed the record, decided that it contained evidence sufficient to support the finding, and accordingly affirmed the judgment. Its concluding observations are especially significant: "Had the court found in accordance with the testimony of the appellant as it appears in the record, it may be admitted that the testimony is sufficient to support a gift, and also sufficient to show illegality of the whole transaction, but as the finding of the trial court to the contrary is sufficiently supported, the judgment must be affirmed, and it is so ordered." (P. 212.) That is quite like our case save that in our case the existence of the issue of illegality was not recognized and the issue was not given to the jury.
 There has been no shifting by Blanchard of the theory of his case since the very first day of the trial when he asked leave to amend. His counsel consistently tried the case throughout upon the theory that the note in suit was void as part of an illegal transaction. He requested instructions on that theory, which were refused by the court. Illegality was later urged by him in support of his motion for new trial. In the light of that history, the issue of illegality is clearly available to Blanchard upon this appeal.
 Tevis further claims that even if the defendant corporation could under these circumstances urge the illegality of the transaction, Blanchard cannot do so because such a defense accrues only to the principal obligor, not to a guarantor.
 The cases he cites are neither apt nor persuasive. In Santa Ana Sugar Co. v. Smith, 116 Cal.App. 422 [2 P.2d 866], the running of the statute of limitations was involved and the guarantor, for a valuable consideration, had waived that as a defense. In Nielsen v. Davidson, 66 Cal.App. 442 [226 P. 835], there was no issue involving a defense by the principal obligor. Nor was Blanchard's contract of guaranty "collaterally and remotely," connected with the asserted illegal transaction as was the contract of sale involved in Boloyan v. Contente, 113 Cal.App.2d 439, 442 [248 P.2d 96]. The contract of guaranty here involved is too thoroughly enmeshed with the questioned transaction to escape the consequences of the illegality, if any, which attached to that transaction. *735
 The question is whether the asserted illegality clearly appears as a matter of law or whether significant facts remain to be determined in the trial court. A brief summary of the pertinent evidence is desirable.
 The defendant corporation (authorized capital, $100,000) was formed by defendant Blanchard and A. M. Brunner to develop and exploit a patented cow milking stanchion which Brunner had invented. May 6, 1947, a state permit was obtained which authorized the corporation to issue not exceeding 33,333 of its shares to Brunner, 33,333 to Blanchard, and 10,000 to one Howard Freeman, all shares issued to be deposited and held in escrow pending written order of the Commissioner of Corporations. The permit prohibited the owners or persons entitled to said shares from consummating a sale or transfer thereof or any interest therein or from receiving any consideration therefor without first obtaining the written consent of the commissioner therefor. No further order or consent and no other or additional permit was obtained from the commissioner.
 Tevis was the first witness. He proved the execution of the note and its nonpayment. He said Blanchard told him he needed $5,000 to go ahead with the cow stanchion device and asked Tevis to advance it, which he did, and that the note was delivered in connection with that advance. Tevis said nothing about a stock transaction.
 There is evidence that Blanchard, president of the corporation, in need of money for development work, interested Tevis in the stanchion and its exploitation and in the corporation and its financing; and that after several meetings and some investigation Tevis began advancing money to the corporation. Blanchard testified that Tevis advanced $5,000 as a part of $15,000 which Tevis was to pay for a 20 per cent interest in the corporation; that various payments totaling $5,000 were made in payment on stock which was to be issued to Tevis, the payments for which the note in suit was subsequently given for the temporary protection of Tevis; after the note was executed no further payments were made by Tevis.
 One of plaintiff's attorneys, Sheldon G. Cooper, testified that Tevis consulted him June 1, 1948, about a business matter he had with Blanchard; that on June 2d, Tevis, Blanchard and the witness discussed the matter. Concerning that meeting, Cooper testified, as plaintiff's witness, on direct examination: "Q. Was there any other discussion regarding *736 finances? A. Yes. My concern, obviously, as a lawyer, was for Mr. Tevis being protected in connection with the advances. That's why I was there. I discussed the matter with Mr. Blanchard and I suggested that a promissory note for the $5,000 which had then been fully advanced or substantially advanced, there may have been one payment a few days later, and Mr. Blanchard said the corporation would give a note and I pointed out to him that this corporate note would be of no value. The corporation had no money and it would be necessary for Mr. Blanchard to endorse the note. My recollection is that Mr. Blanchard consented to guarantee the corporate note. There was then some discussion as to the consideration that Mr. Tevis was to get for these advances, and to my best recollection, there were so many conferences, my best recollection is at that time at least it was discussed, if not agreed, that Tevis would get 20 percent of the stock of the company. Q. I show you a document submitted in evidence as Plaintiff's No. 1 and ask you if that was the promissory note that was ultimately executed as a result of that conversation? A. Yes, that is the one."
 Later, Tevis informed Cooper that a Mr. Merrill, a contractor who could do the contract work and would be a great advantage to this enterprise, was coming into the "deal." Further meetings ensued, commencing June 8th, looking toward the acquisition by Merrill and Tevis of a one-third interest each in the corporation. This involved the acquisition of Brunner's one- third interest. This plan was not consummated. Cooper prepared several drafts of an agreement therefor but none was executed.
 The note in suit was executed June 9, 1948. It was ratified by the board of directors of the corporation on July 26th of that year.
 On August 31, 1948, Cooper wrote a letter to the defendant corporation in which he said in part: "As you are aware an agreement was entered into between the Brunner-Blanchard Corporation and Lansing Tevis whereby Mr. Tevis was to advance to the corporation the sum of $15,000.00 from time to time as call was made upon him by the corporation. In return the corporation was to issue 20 per cent of its total authorized stock to Mr. Tevis. Mr. Tevis has already advanced the sum of $5000.00 and stands ready to complete his performance under the contract. You have indicated that the corporation intends to repudiate its obligation under the agreement. We are authorized by Mr. Tevis *737 to make demand upon you that the corporation take appropriate action immediately to perform its agreement and issue to him the proper number of shares." Cooper testified upon cross- examination that the first two sentences of this letter incorporated the original agreement between the parties and that the $5,000 advance mentioned in the letter was the only $5,000 which Tevis advanced.
 Cooper also testified, "Yes, we met on a number of occasions, but we met in connection with the promissory note. Mr. Tevis had advanced funds and had no evidence of liability of either Mr. Blanchard or the corporation and I was disturbed about it and I had called him a couple of times and he came to my office and the note was prepared and he signed on behalf of the company and also as the guarantor."
 There is evidence that Tevis took an active part in the management of the corporation, looking after its San Francisco office and cosigning all checks issued by it. Tevis testified that the reason for his signing those checks was that Blanchard needed two signatures; he presumed that he signed the signature card that went to the bank; he signed those checks at the request of Blanchard; presumably those checks were part of the $5,000 he had advanced.
 Here is evidence of an illegal transaction, an agreement by the corporation to issue and sell shares of its capital stock without a permit therefor, and the acceptance by it of a part of the purchase price. Every corporation is prohibited from selling a security of its own issue without a permit. (Corporate Securities Law, Corp. Code,  25500.) A corporation which directly or indirectly offers or negotiates for sale of a security contrary to the provisions of the act or in nonconformity with a permit or which applies any portion of the proceeds of sale to any purpose not specified in a permit is guilty of a public offense punishable by a fine. (Corp. Code,  26103.) Penalties are imposed upon any officer or employee of a corporation, and every other person, who aids or assists in the sale of such a security in nonconformity with a permit. (Corp. Code,  26104.) "Security" includes any stock, including treasury stock. (Corp. Code,  25008.) "Sale" includes disposition or attempt to dispose of a security for value, also includes offer to sell, attempt to sell, solicitation of a sale, and the taking of a subscription. (Corp. Code,  25009.) [3] A corporation actively participates in such a sale when it accepts the proceeds or a portion of the proceeds of the sale. (See Randall v. Beber, 107 Cal. *738 App.2d 692, 700 [237 P.2d 994]; People v. Beber, 104 Cal.App.2d 359, 369 [231 P.2d 516], and cases cited.) It is the act of selling that is primarily placed under the examination of the Corporation Commissioner. (People v. Sidwell, 27 Cal.2d 121, 127 [162 P.2d 913].) [4] "The imposition by statute of a penalty implies a prohibition of the act to which the penalty is attached, and a contract founded upon such act is void." (Smith v. Bach, 183 Cal. 259, 262-263 [191 P. 14]. See, also, Duntley v. Kagarise, 10 Cal.App.2d 394, 397 [52 P.2d 560], and cases there cited.)
 There is evidence that the note to Tevis was given as an integral part of the stock sale transaction. [5] A finding of fact to that effect would warrant the legal conclusion that the element of illegality infects the note and renders it void. (See People v. Sidwell, supra, 27 Cal.2d 121, 129; People v. Woodson, 78 Cal.App.2d 132 [177 P.2d 586]; Duntley v. Kagarise, supra, 10 Cal.App.2d 394.) [6] Also, a "promissory note may not depend upon a consideration which is a violation of an express statutory inhibition." (Ludwig v. Steger, 99 Cal.App. 235, 237 [278 P 494].) [7] There is evidence that the contract of guaranty was an integral part of the transaction and as such equally infected with illegality.
 Illegality would attach, as we have noted, because the Corporate Securities Act prohibits the making of such a sale or the acceptance of any of the purchase price and imposes penalties upon the corporation, its officers, agents, and other persons aiding in the sale. The statute does not expressly impose penalties upon the buyer. [8] Unless he participates in such a fashion, with such a degree of culpability as to put him in pari delicto with the corporation and its representatives, he is not without remedy. Under appropriate circumstances he may rescind, tendering the return of whatever of value he has received; if he has received nothing of value, he may without such a tender sue in damages for money or the property, or its value, which he paid or delivered or he may sue for money had and received. (See Randall v. California L. B. Syndicate, 217 Cal. 594, 598-599 [20 P.2d 331]; Bourke v. Frisk, 92 Cal.App.2d 23 [206 P.2d 407]; Randall v. Beber, supra, 107 Cal.App.2d 692, 701.) [9] In an action for money had and received against a participant in the sale, such as an officer of the corporation making the sale, the buyer's right to recover is limited to the value of that which that participant received; not so limited if the buyer's action is for damages. (See Randall v. Beber, supra, 107 Cal.App.2d 692, 701, and authorities there cited.) *739
 The difficulty with this case is that none of the questions of fact involved under the issue of illegality were given to the jury. We do not see that a reviewing court could make findings of fact from this record. Some consideration must be given to Tevis' testimony. He spoke solely of a loan, not of a stock transaction. Cooper spoke both of a loan and of a stock transaction. What really happened when the note was executed? Did the note represent a withdrawal by the parties from their original "agreement" and the making of an entirely new start? At that time, if Tevis was not in pari delicto, could not the parties have cancelled their "deal"? If they did, may not Tevis have been entitled to the return of his money, or a promissory note if the corporation had no money? The very fact that negotiations continued and the drafting of a written agreement upon a new basis was undertaken, may be some indication that such was the fact. The statements appearing in counsel's letter of August 31, 1948, would not necessarily preclude Tevis from making such a showing if that is what really occurred. It is the function of the trier of the facts, not the function of the reviewing court, to evaluate the testimony, draw inferences from the evidence, and find the material and ultimate facts.
 Neither party is entirely without fault for the situation which now obtains. At the beginning of the trial (two years and eight months after answer filed) the defendants presented and asked leave to file an amendment to their answer, presenting the issue of illegality. Plaintiff resisted upon the ground that it came too late. The court denied the request, observing that the defendants had not acted promptly. The amendment should have been allowed but its denial was not prejudicial because the issue of illegality later did arise, through the evidence introduced. Throughout the trial, counsel for defendants insisted that illegality was an issue. Plaintiff's counsel with equal insistence contended it was not. Defendants requested two instructions on this issue which were not given the jury. One was proper; the other not, for it amounted to a direction to find for the defendants. Counsel for plaintiff could not have been unaware of the likelihood that illegality would become an issue, from their familiarity with the dealings between the parties, commencing as early as June 1, 1948, plus the fact that in plaintiff's answer (filed 2 1/2 years before the trial) to one of the counts of the cross-complaint, they alleged that Blanchard agreed to transfer one-third of the outstanding stock of the corporation as additional *740 consideration for the advancing of "the sum alleged" ($15,000 for purchase of an interest in the stanchions, as averred in the cross- complaint), but that Blanchard refused to effect a transfer. The judgment should be reversed and the cause remanded for new trial. The order denying the motion for judgment notwithstanding the verdict should be affirmed.
 Blanchard contends there is no occasion for a new trial because all counts of the complaint sound in contract, none in damages or for money had and received. That puts undue emphasis upon the form of pleadings which under appropriate circumstances may be amended to conform to proof. Also, it leaves out of account the possibility of proof of a legal contract.
 Tevis contends there is no occasion for a new trial because, as he asserts, the order of nonsuit on the cross-complaint determined that there was no agreement for purchase of an interest in the corporation. That is not correct. One count of the cross-complaint pleaded a debt owing from Tevis to Blanchard for services rendered by Blanchard. The other count pleaded an undertaking by Tevis to advance $15,000 "to pay certain expenses of promoting cow-milking stanchions, in consideration of an interest therein to plaintiff when he paid said sum in full." Neither count of the cross- complaint pleaded an agreement to acquire an interest in the corporation. The order of nonsuit at the very most determined that there was no express or implied agreement in respect to services of Blanchard and no agreement to advance moneys for an interest in the cow-milking machines.
 The trial court will, of course, allow such amendments to the pleadings as either party may request and the court may find appropriate and in furtherance of justice, if such amendments are promptly tendered.
 The judgment is reversed and the cause remanded for new trial. The order denying the motion for judgment notwithstanding the verdict is affirmed.
 Appellant to recover costs on appeal.
 Peters, P. J., and Bray, J., concurred.
