can sex help sadness?

I have been unlike my self thinking about things I cant control. Kinda like a mini depression and just had sex with my boyfriend (which i haven't done in a month) i felt more myself after we had sex. Am i lying to myself or does sex release some type stress. We haven't had sex in a while and I think the lack of that affects how im thinking oddly. Can hormones affect your thoughts?*note* I have gotten help for my problems and ive felt better&  im praying through it  but im an overthinker and I reinvert back to bad habits.