Allah doesn't punish anyone until they've heard the message. This is very clear in the Quran in several ayat. In Surah al-Isra' 17:15 =
And We never punish until We have sent a Messenger
And the coversation with the people of hell as it comes in Surah az-Zumar 39:71 =
'And those who disbelieved will be driven to Hell in groups, till,
when they reach it, the gates thereof will be opened. And its keepers
will say, "Did not the Messengers come to you from yourselves, -
reciting to you the Verses of your Lord, and warning you of the
Meeting of this Day of yours?" They will say: "Yes, but the Word of
torment has been justified against the disbelievers!"'
So no one will be punished or held accountable for something they had no control over. This includes someone who hasn't heard of the message of Islam or even knew that there were Messengers from Allah.
There's a long hadith attributed to the Prophet Mohamed in Musnad Ahmed and it'll give a good idea on what will happen to people who did not hear the message =
al-Aswad b. Sari reported the Prophet said:
"There are four will come to Allah on the Day of Resurrection: the
deaf man who never heard anything, the insane man, the very old man,
and the man who died during the fatrah (the time between Jesus and
Mohamed). The deaf man will say, ‘O Lord, Islam came but I never
heard anything.’ The insane man will say, ‘O Lord, Islam came but the
children ran after me and threw stones at me.’ The very old man will
say, ‘O Lord, Islam came but I did not understand anything.’ The man
who died during the fatrah will say, ‘O Lord, no Messenger from You
came to me.’ He (Allah) will accept their promises of obedience, then
word will be sent to them to enter the Fire. By the One in Whose hand
is the soul of Mohamed, if they enter it, it will be cool and safe for
And there was another hadith where it says Allah will test them on day of judgment. But I couldn't find it right now. However, I think this should give you some idea.