Details of a letter written by a mother who allegedly killed her two sons while suffering from major depression have been revealed in court.