Apparatus is provided for treating a condition of a subject, including an energy transmitter, which is configured to be positioned outside a body of the subject in a vicinity of a site selected from the group consisting of: a sphenopalatine ganglion (SPG), a greater palatine nerve, a lesser palatine nerve, a sphenopalatine nerve, a communicating branch between a maxillary nerve and an SPG, an otic ganglion, an afferent fiber going into the otic ganglion, an efferent fiber going out of the otic ganglion, an infraorbital nerve, a vidian nerve, a greater superficial petrosal nerve, and a lesser deep petrosal nerve. A control unit is configured to drive the energy transmitter to transmit energy to the site, and configure the energy to stimulate the site. Other embodiments are also described.