Hey Carl! There are a few factors to consider. However since it works at iCloud.com, tells me the Apple server is working okay. Other factors may be the network, account settings, and even your device’s available storage.
Normally also even full iCloud storage will prevent even sending one email, but since you can send from iCloud.com, that’s probably not the case.
That said, do you use a third party/non-Apple email address for your Apple ID? Just wondering if, on your iPhone, you are actually sending from your email provider, or your Apple ID. You may also have an alias to your Apple ID, such as @iCloud/Mac/Me.com.
If you do use a third party email address for your Apple ID, can you log into their web site and try sending an attachment? That may provide the answer.
If that’s not the case, let me know, as well as the available iCloud and device storage, what accounts providers that are set up on your devices, (iCloud, Gmail, Yahoo, Etc.). As well as if the same happens on other networks/devices/email accounts/email clients/other browsers.
Also your email account storage quota may be a factor, I know I’m Apple Mail, on Mac, you can right click the Inbox or other mailbox, and select “Get Account Info”, and this will show the used and available storage for that particular account. If it is another account other than iCloud, this maybe another possible cause.
Sorry, it’s a lot of info at once, just let me/us know what you find, Hope I can help out!