At the castle Orsino is in love with Olivia but Olivia will not accept any of his letters because she is too sad about the death of her father and brother. Viola was in a shipwreck and is sad about loosing her twin brother who drowned.
Maria comes up with a plan to get back at Malvoio so she writes him a letter that is "from Olivia" and tells him to wear bright yellow stockings and to smile always.
Olivia confesses her love for Cesario which puts Viola in an uncomfortable position
Viola denies that she married Olivia and attacked Andrew and Toby. Then Olivia marries Sebastian, Viola marries Orsino and Toby marries Maria