Miners in Chile face four months trapped underground while an escape tunnel is built Reuters

Joy greeted the news that a group of Chilean miners trapped for 17 days deep inside a collapsed mine are all alive but the challenge now facing the 33 men is to maintain their sanity during the four months it will take to free them.

A rescue probe that drilled down 2,257ft to the bottom of the San José mine made contact with the miners yesterday, who sent back a message reading: "All 33 of us are well inside the shelter."

A note from the eldest of the trapped miners to his wife Lilian Ramírez indicated that the men were aware of the challenge facing them but confident that they would prove equal to it.

"Even if we have to wait months to communicate … I want to tell everyone that I'm good and we'll surely come out OK," Mario Gómez, 63, wrote, scrawling the words on a sheet of notebook paper that the miners tied to the probe. "Patience and faith. God is great and the help of my God is going to make it possible to leave this mine alive."

Video footage of one of the miners, taken with a small camera sent underground after receipt of the handwritten message, was obtained by CNN Chile. There has been no audio contact yet but the unnamed man appeared to be in good spirits.

Chilean authorities intend to send microphones down to communicate with the miners directly. Food, water, medicine and other supplies will also be sent down into the mine.

Rescue equipment from around the world is being rushed in to build an underground escape tunnel.

But officials said it would take at least four months to carve a second shaft some 68cm in diameter, wide enough for the miners to be pulled up one by one.

Davitt McAteer, the assistant secretary for mine safety and health at the US labor department under Bill Clinton said the miners' survival after 17 days was unusual but he predicted that having made it this far, they would emerge physically fine.

"The health risks in a copper and gold mine are pretty small if you have air, food and water," he said.

But he said the stress of being trapped underground for a long period of time could be significant. "There is a psychological pattern there that we've looked at," McAteer said. However, he added: "They've established communication with the guys; there are people who can talk them through that."

The miners were trapped on 5 August by a collapse in the roof of the mine, located outside the northern Chilean city of Copiapó. Mine officials had said the shelter's emergency air and food supplies would last only 48 hours.

Gomez wrote that the miners had created a canal of fresh water and used electricity from a truck engine to rig up lighting deep inside the copper mine, apparently creating a makeshift refuge.

From the day the mine collapsed, dozens of relatives staked out what they call Camp Hope near the mouth of the mine, where they built shrines and composed songs, hoping that rescue efforts would arrive in time to save the men.

President Sebastián Piñera, who read out Gomez's note live on television, said: "All of Chile is crying with excitement and joy."