changing o2 username on icloud

I have two iphones bought before o2 ceased to provide email services. I cannot now delete this o2 username to replace with a current email address. I cannot trade in my older iPhone until I have deleted the account.
How can I change the locked username?
I have two iphones bought before o2 ceased to provide email services.
Okay
I cannot now delete this o2 username to replace with a current email address.
Why not? Can you not go to Settings-Mail, Contacts, Calendars and tap on the O2 account, and then select "Delete Account" at the bottom?
I cannot trade in my older iPhone until I have deleted the account.
If you go to Settings-General-Reset and then select "Reset All Contents & Settings", your device will be restored and set to used like it was when you first took it out of its box.
How can I change the locked username?
What locked username?

Original thread: https://forums.imore.com/threads/changing-o2-username-on-icloud.277648/