This locks the webmail until the message is sent. Ideally, once I press send, that becomes a background task.
Not sure how to handle the possible error though...
We need to overcome sync sending as it blocks the whole UI while smtp transaction is in progress. However, sending may fail, which also makes a need for keeping the smtp state. Is an Outbox a good idea here? Should we just maybe flag or tag the Draft message until sent and show it in Outbox? Outbox would be shown only if there are any messages which are flagged in Drafts.
I have a library which should be able to deal with sending and retries OOB:
https://git.sr.ht/~sircmpwn/dowork
Could stash it in an Outbox after we give up, perhaps?
I'd just leave it in Drafts, and show a "this message is being sent" message when showing the draft message.
Sending attachments is special case as upload has to be waited for? Any suggestions how to handle this, with/without Javacript?
If sending fails, what happens with the message and how will we let the user know?