I think there might be a way.
As other answers have mentioned, emotional responses are pretty complicated things.
Some emotions are more readily induced or modulated than others, and the more complex the emotion the more complex the means of effecting it needs to be.
Some real-world foods can make you happier some of the time simply because they're high in carbs. High-carb foods reduce stress hormone release in the brain.
As has been mentioned already, getting very precise at this point seems to require access to the inside of the brain itself and being able to distinguish between and selectively modify specific regions in specific ways.
The solution depends on how techy you want your story to be. If you're both going for a super high tech/robotic setting and want accuracy, you could use nanobots that migrate to specific regions of the brain on their own over time, then receive signals of some form or other in order to provide the necessary response.
nanobots migrate to their specified locations
nanobots recieve signal
appropriate nanobots release/trigger release of appropriate neurotransmitters
This signal could come in various forms and could even be food if you figured out how to send specific messages to the various nanobots based on food consumed.
Maybe you could just find some set of neutral compounds that don't exist in food/other ingestables and have a different set of nanobots in the digestive tract that detect the presence of those and their relative proportions, interpret those proportions as a specific emotional response, then send the correct message to the nanobots in the brain.
Some kind of wireless mesh network between the nanobots might be able to simplify this whole system enormously, but I'm not sure how capable those wireless systems would actually be. Range in particular would be an issue between the stomach/intestines and the brain. This might be solvable with some kind of relay network across that distance.