If you are a tenant living in a foreclosure property with or without a written lease agreement you have the right to receive a minimum of 90 days notice before an eviction proceeding can begin under the Protecting Tenants at Foreclosure Act, S896, Sec. 702.
Under California law the 90 days does not start until after the new owner contacts you personally in writing with a "Notice to Pay Rent or Quit". The notice must be in "writing, requiring its payment, stating the amount which is due, the name, telephone number, and address of the person to whom the rent payment shall be made" under California Code of Civil Procedure section 1161.
Of course knowing your rights and effectively asserting your rights are two different things. There are plenty of evictions that move forward despite the fact that the tenant in the foreclosure was not provided 90 days notice. Ironically the person deprived 90 days notice has the obligation to file a motion in court to demand the notice they were deprived. For most tenants this makes the Protecting Tenants at Foreclosure Act worthless since the burden of demanding ones rights is placed on the tenant, and that burden requires either finding an attorney or having a working knowledge of the courts.
That is why I have developed fill in the blank forms for a Demurrer which is a motion to dismiss the case without trial that you can file with the courts. Simply fill in the blanks, mail a copy to the landlord's attorney along with the other documents listed below, keep a copy for yourself, and show up in court on the day you are scheduled.
The first form is a Notice of Demurrer which is a notice that you are asking the court to dismiss the eviction proceeding because the Unlawful Detainer Complaint is in clear error due to a failure to provide proper notice.
The second form is the Demurrer which is the actual argument for the dismissal.
You will also need to fill out a "Prejudgment Claim of Right to Possession"
You will also need to have someone else mail the copies to the attorney and have that person fill out a "Proof of Service by First Class Mail" or "Proof of Personal Service" if hand delivered.
Also, you may qualify to have your fees waived so you should probably fill out a fee waiver form. Do not mail this to your landlords attorney because your financial standing is confidential. The rest of the documents must be copied in triplicate with the original filed with the courts, a copy for your landlords attorney, and one for yourself.
Remember, if this doesn't work don't give up. This is merely an opening salvo to shut down the eviction process immediately and get the new owner and their lawyers to come to the table and negotiate.
If your demurrer is over-ruled the next step is to file an Answer while attempting to negotiate with the owner. In some cities like Oakland there are Just Cause for Eviction Ordinances which prohibit evictions after a foreclosure. In such cities you can win the right to stay in your home if you keep up the fight and learn your local ordinance.
As always I must state that I am not an attorney and do not guarantee the effectiveness of this advice nor the documents linked to this post.
Fight back at your own risk.... or good fortune.