The testes and ovaries are the glands that are most directly involved in sexual function. The testes produce sperm and testosterone, which encourage the penis to grow as men age, help men maintain a healthy sex drive, and promote sperm production. The female equivalent, the ovaries, produce ova, estrogen, and progesterone. They encourage breast development and help women maintain regular and healthy periods.
These aren’t the only glands that play a role in sexual function. The pituitary gland produces a range of hormones, including prolactin, which can play a part in male sexual problems and luteinizing hormone, which regulates estrogen and testosterone. The thymus secretes hormones that are important during puberty. Together these glands ensure that the body functions as it should during sex and reproduction.