Things to check:
Run SpeedTest app or equivalent website and see if you actually do have a connection.
If you do have a connection, do you have a 3rd party VPN installed, even if you are not using it? If so, delete the VPN profile in Settings/General/VPN & Device Management/VPN. Don't just turn it off; delete the profile. If that fixes it, you can try reinstalling VPN.
If you don’t, the problem is most likely your router:
- On your iPhone, go to Settings/Wi-Fi and tap on the i next to the network name. Does the IP address begin 169.254? If it does, reboot your router (probably a good idea to reboot it anyway).
- Are you using Access Control (AKA Mac Filtering) on your router? If so, make sure the iPhone’s Wi-Fi IP address is in the whitelist.
Finally, does it say you need Wi-Fi specifically, or an internet connection? You need to have Cellular Data enabled to send images using MMS, even if you have a Wi-Fi connection.