Former Microsoft Corp. general counsel Brad Smith talked with Bill Gates about “flirtatious” emails he sent to a midlevel employee in 2007, and also notified some members of the company’s board, according to The Wall Street Journal.

Smith, who now serves as Microsoft’s president and vice chair, faced one of the most difficult situations a GC can encounter—dealing with a top-level executive’s alleged misconduct—and he appears to have responded appropriately, according to a pair of former in-house leaders and corporate ethics experts.