The Intelligence Organization of the Islamic Revolution Guards Corps has detained several foreigners, including Britain's second most senior envoy in Tehran, for acts of spying such as taking earth samples in restricted areas, Iranian news agencies say.