Envelope glycoprotein important for virion assembly and egress. Plays a role in the correct incorporation of gH-gL into virion membrane. Directs the glycoprotein N (gN) to the host trans-Golgi network. Interacts (via N-terminus) with gN (via N-terminus). The gM-gN heterodimer forms the gCII complex. During virion morphogenesis, this protein accumulates in the trans-Golgi network where secondary envelopment occurs. Belongs to the herpesviridae glycoprotein M family.