H II envelopes created by mass loss