Depression imposes a heavy burden on patients and society, and current antidepressants often cause side effects such as dryness in the mouth and constipation. The explorations about aromatic plant essential oils provide a new method for the treatment of depression, but the mechanisms of antidepressant effect of these oils are not deeply enough. Here, the rosemary essential oil analyzed by GC-O and GC-MS techniques, whose main aromatic compounds are determined as 1,8-cineole (OAV = 1869.27, AI = 9.4), linalool (OAV = 1668.90, AI = 5.4), and ethyl decanoate (OAV = 1169.09, AI = 6.9). The network pharmacology was employed to investigate the possible pathway of action for antidepressant effects of the rosemary essential oil, and Gface software that can capture facial expressions was used to harmony the aroma to make the oil more pleasant. Then, the harmonious essential oil was proved to have antidepressant effects. For addressing issues of strong volatility and oxidation susceptibility of essential oil, dendrimer-like γ-cyclodextrin was prepared and encapsulate the essential oil. The obtained microcapsule prolonged fragrance duration and presented good stability, which are applied in aromatherapy and daily care products. This study lays a theoretical and methodological foundation for essential oil efficacy research and provides new strategies for designing and producing functional products related to essential oils.