Apparently, "extra Ecclesiam nulla salus" first appeared in a letter from Cyprian of Carthage (d. 258) about  re-baptizing those who had been baptized by heretics. Cyprian believed that baptism given by heretics was invalid, and thus those baptized by them were not actually members of the Church.