The team measured negative mood, positive mood, physical activity, diet and sleep three times a week over a six week period in a group of 138 older people due to have their flu jab.
They then examined how well the jab was working by measuring the amount of influenza antibody in the blood at four weeks and 16 weeks after the vaccination.
Researchers found that of all the factors measured, only positive mood over the six week observational period predicted how well the jab worked - with good mood associated with higher levels of antibody.
When looking at influences on the day of vaccination itself, the study, published in the journal Brain, Behavior and Immunity, found an even greater effect on how well good mood worked, accounting for between eight and 14 per cent of the variability in antibody levels.
Vaccinations are an incredibly effective way of reducing the likelihood of catching infectious diseases. But their Achilles heel is that their ability to protect against disease is affected by how well an individual's immune system works, researchers said.
People with less effective immune systems, such as the elderly, may find vaccines do not work as well for them as they do in the young, they added.