
37 Cal.App.2d 74 (1940)
FIRST BOND AND MORTGAGE COMPANY OF GLENDALE, CALIFORNIA (a Corporation), Appellant,
v.
B. I. MALOUF, Respondent.
Civ. No. 12410. 
California Court of Appeals. Second Appellate District, Division Two.  
January 31, 1940.
 Arthur L. Syvertson and Lyle C. Newcomer, Jr., for Appellant.
 Nichols & Mattoon for Respondent.
 McComb, J.
 From a judgment in favor of defendant after trial before the court without a jury in an action to recover damages for breach of a written contract plaintiff appeals.
 These are the essential facts:
 Plaintiff was a mortgage and discount company. Defendant owned and controlled the Standard Discount Corporation a corporation engaged in a business similar to that of plaintiff. In September, 1933, defendant purchased a controlling *76 interest in plaintiff corporation and elected himself and two employees of the Standard Discount Corporation as the board of directors of plaintiff. At the time defendant purchased a controlling interest in plaintiff, plaintiff had an agreement with W. H. Andrews to sell him 500 shares of its stock for $50,000. Mr. Andrews had paid $38,000 on the purchase price, leaving a balance of $12,000. When defendant became interested in plaintiff corporation, Mr. Andrews threatened to rescind his agreement and negotiations commenced between the defendant and Mr. Andrews, resulting in a settlement by the terms of which Mr. Andrews agreed to accept 345 shares of plaintiff's stock and plaintiff agreed to cancel its contract with him under which he owed plaintiff $12,000. This settlement was consummated by defendant's depositing his certificate No. 517 for 587 shares of stock with plaintiff and receiving back certificate No. 526 for 242 shares of plaintiff's stock. Certificates 522 to 525 for the total number of 345 shares of plaintiff's stock were issued to Mr. Andrews. Shortly thereafter defendant caused to be issued to the Standard Discount Corporation two checks in the total sum of $34,500.
 Subsequently other stockholders of plaintiff organized a committee of preferred shareholders who had an audit made of plaintiff's books and threatened to commence suit against defendant. This controversy was settled by an agreement dated January 23, 1934, between defendant as first party, the shareholders committee as second parties, and plaintiff as third party. The agreement, after reciting in a preamble the dispute between the parties, contained among others the following provisions:
 "FIRST: First party [Malouf] will forthwith return to the account and possession of third party [the corporation] 104 shares of the preferred stock and 47 1/2 shares of the common stock of third party, and third party agrees, upon receipt of said stock, to deliver to first party its certified check in the sum of $520.00 in payment and satisfaction of any lien which first party may claim thereon."
 "SECOND: First party [Malouf] contemporaneously with the execution of this agreement, shall forthwith deliver to third party [the corporation] his certified check payable to the order of third party in the sum of $34,500.00, which said *77 sum shall be credited on the books of third party as the return of a like sum which was withdrawn from the possession of third party and paid to first party through the Standard Discount Corporation, a corporation operating within the State of California."
 "THIRD: First party [Malouf] will forthwith deliver to third party a certified check payable to the order of third party in the sum of $15,642.43, plus interest at the rate of eight per cent (8%) per annum, from January 1, 1934, to the date of delivery, which said payment shall be in full satisfaction of a loan in that amount heretofore made by said third party to the Standard Discount Corporation."
 "FIFTH: First party [Malouf] will forthwith deposit in escrow with L. J. Styskal, Esq., attorney at law, Los Angeles, California, 587 shares of Preferred stock and 2253 shares of Common stock of First Bond & Mortgage Company of Glendale, the third party herein, endorsed in blank, said L. J. Styskal to act as, and he is herein and hereby named as escrow holder for all of the parties hereto in connection with said stock and other properties and transactions hereinafter enumerated."
 "ELEVENTH: First party [Malouf] represents to second parties that the current financial condition of third party is as set forth in the financial statement of third party for December 31, 1933, which is attached hereto and marked Exhibit 'B', save and except wherein properties have been exchanged or converted into cash in accordance with the usual and ordinary business transactions of third party had since that date, and excepting such expenditures made in the regular routine of business of third party, including maintenance, repair and upkeep of real and personal property, and all of the parties hereto understand that this agreement is being entered into on that basis."
 Exhibit "B" referred to in the foregoing paragraph read as follows: *78
 Tabular Material Omitted
 "'Exhibit B' FIRST BOND AND MORTGAGE COMPANY OF GLENDALE, CALIFORNIA FINANCIAL STATEMENT December 31, 1933"
 Shortly before defendant executed the agreement of January 23, 1934, above mentioned, he caused his secretary to take from the stock certificate book of plaintiff corporation certificate No. 517 for 587 shares of the preferred stock of plaintiff which he had theretofore surrendered and which had *79 been marked cancelled and to remove with ink eradicator the cancellation marks on the stub of the stock certificate book opposite certificate No. 517.
 He surrendered certificate No. 526 for 242 shares and a notation was made indicating that said last mentioned stock certificate had been cancelled on November 23, 1933, the date it was issued.
 The result of this was to increase the amount of plaintiff's preferred shares outstanding by 345 shares (a par value of $34,500) with the result that the capital stock liability was raised from $363,400 (the amount shown on "Exhibit B") to $397,900 and the deficit of the corporation was increased from $104,849.39 to $139,349.39. At the time of executing the agreement above mentioned defendant delivered certificate No. 517 for 587 shares of the preferred stock of plaintiff to L. J. Styskal as performance of defendant's obligation under paragraph five of the above agreement.
 The trial court permitted defendant to introduce extraneous evidence to support his claim that the $34,500 which defendant paid to plaintiff under paragraph two of the above agreement was so paid in accordance with an agreement between the parties that defendant should be entitled to receive from plaintiff 345 shares of preferred stock which he had surrendered when the settlement was effected with Mr. Andrews in November of 1933. Upon this evidence the trial court predicated among others a finding reading thus:
 "... It was agreed by and between the plaintiff and the defendant that on repayment by defendant to the plaintiff of said sum of $34,500 the plaintiff would reissue to defendant the same number of shares as it had issued to said Andrews out of the certificate delivered by defendant to the plaintiff, namely 345 shares of its preferred capital stock; ..."
 This is the sole question necessary for us to determine:
 [1] Did the trial court commit prejudicial error in receiving extraneous evidence to show the reason defendant paid plaintiff $34,500 under the second paragraph of the above mentioned agreement?
 This question must be answered in the affirmative. The law is established that when the terms of an agreement have been reduced to writing by the parties it is to be considered as containing all the terms of the agreement and there can be, *80 between the parties and their representatives or successors in interest, no other evidence of the terms of the agreement than the contents of the writing except (1) where a mistake or imperfection in the writing is put in issue by the pleadings, (2) where the validity of the agreement is the fact in dispute, or (3) to explain an ambiguity in the agreement. (Sec. 1856, Code Civ. Proc.; sec. 1625, Civ. Code; United Iron Works v. Outer Harbor etc. Co., 168 Cal. 81, 84 [141 P. 917]; Barnhart Aircraft, Inc., v. Preston, 212 Cal. 19, 22 [297 P. 20].)
 [2] It is likewise settled that a contract may be explained by reference to circumstances under which it was made and the matter to which it relates, where the language used is doubtful, uncertain, or ambiguous, but that this exception to the general rule is applicable only where the doubt appears on the face of the contract. Where the language is clear and explicit in the written agreement the intention of the parties is to be ascertained from the writing alone. (Courtright v. Dimmick, 22 Cal.App.2d 68, 70 [70 PaCal.2d 269].)
 [3] The present case, it is conceded, does not fall under either the first or second exceptions to the general rule noted above. From an examination of the second paragraph of the agreement it is clear that said paragraph was free from ambiguity, the parties having stated in the simplest language that defendant agreed to pay to plaintiff $34,500 on account of a like sum that defendant had withdrawn from plaintiff through the Standard Discount Corporation, a corporation owned and controlled by defendant. Therefore, since there was no ambiguity in this clause of the agreement, the trial court committed prejudicial error in permitting extraneous evidence to be introduced for the purpose of explaining its meaning and in basing a finding of fact as set forth supra upon such extraneous evidence.
 For the foregoing reasons the judgment is reversed.
 Moore, P. J., and Wood, J., concurred.
