Both cold sores (caused by oral herpes) and genital herpes can be caused by the same family of viruses, which include: herpes simplex virus type 1 (HSV-1) and herpes simplex virus type 2 (HSV-2). Valacyclovir can be used to treat both infections.