 He was a Justice of the New York Court of Special Sessions from 1902 to 1903.He was Attorney General of New York from 1903 to 1907.Mayer was nominated by President William Howard Taft on February 19, 1912, to a seat on the United States District Court for the Southern District of New York vacated by Judge George Bethune Adams.