Mammals
Melatonin, produced in the pineal gland which is outside of the blood–brain barrier, acts as an endocrine hormone since it is released into the blood.
Melatonin can suppress libido by inhibiting secretion of luteinizing hormone (LH) and follicle-stimulating hormone (FSH) from the anterior pituitary gland, especially in mammals that have a breeding season when daylight hours are long. The reproduction of long-day breeders is repressed by melatonin and the reproduction of short-day breeders is stimulated by melatonin. During the night, melatonin regulates leptin, lowering its levels.
Light/dark information reaches the suprachiasmatic nuclei (SCN) from retinal photosensitive ganglion cells, which are intrinsically photosensitive photoreceptor cells that are distinct from those involved in the primary (at least, from one point of view) image formation function of the eye (that is the rods and coness of the retina). These cells represent approximately 2% of all retinal ganglion cells in humans and express the photopigment melanopsin.
Melanopsin, often confused with melatonin because of its similar name, is structurally unrelated to the hormone. It is a conventional 7-transmembrane opsin protein with the usual vitamin A-like cis-retinal cofactor having a peak absorption at 484 nm, in the blue light part of the visible spectrum. The photoperiod cue created by blue light (from a blue image of the sky) entrains a circadian rhythm, and thus governs resultant production of specific "dark"- and "light"-induced neural and endocrine signals that regulate behavioral and physiological circadian rhythms associated with melatonin. Melatonin is secreted in darkness in both day-active (diurnal) and night-active (nocturnal) animals.
Read more about this topic: Melatonin