A herpes IgM (immunoglobulin M) test is a blood test that can detect early herpes simplex virus (HSV) infection. HSV is a contagious condition that causes sores around the mouth or genitals. The IgM test does not detect herpes directly. Instead, it looks for IgM, a type of antibody.