The 52-year-old actor was scheduled to attend the event, but had to skip it due to the infection.
"We really wanted to attend the ceremony, but recently, after a test, I was diagnosed with H1N1, that is swine flu...I have been asked to take rest and cannot go and attend any public function so I am skipping the event so that others do not contract it," Mr Khan told the audience.
His wife Kiran Rao, co-founder of Paani Foundation, was seen sitting next to him during his video address.
A source close to the actor told PTI, "Today, during the video conferencing of Paani Foundation he confirmed that he has got it (swine flu). He is getting treated at home".
"Kiran contracted it from Aamir. As a result of the infection, they (Aamir and Kiran) were not able to remain present for the most important day of Paani Foundation- the annual prize distribution," the source said.
"Since today is friendship day, I requested my friend Shahrukh to attend the function on my behalf and he readily accepted," said Mr Khan said.
The 'Lagaan' actor congratulated all the villages, who took part in 'Satyamev Jayate Water Cup 2017'.
Maharashtra Chief minister Devendra Fadanvis, Reliance Foundation founder Neeta Ambani, industrialist Rajiv Bajaj were also present at the event.