Oral herpes is a very common infection and it spreads through salvia or mucus membranes on the skin- it's very common for children to have it even, so it's not anything to do with sexual contact. Your doctors diagnosis is likely correct, but if the medication isn't working, give your doctor a call and let them know.